aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.test/runnable/complex3.d
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gdc.test/runnable/complex3.d')
-rw-r--r--gcc/testsuite/gdc.test/runnable/complex3.d31
1 files changed, 31 insertions, 0 deletions
diff --git a/gcc/testsuite/gdc.test/runnable/complex3.d b/gcc/testsuite/gdc.test/runnable/complex3.d
new file mode 100644
index 0000000..7167b0b
--- /dev/null
+++ b/gcc/testsuite/gdc.test/runnable/complex3.d
@@ -0,0 +1,31 @@
+// https://issues.dlang.org/show_bug.cgi?id=23778
+
+
+enum __c_long_double : double;
+
+alias __c_long_double c_long_double;
+
+struct _Complex
+{
+ c_long_double re;
+ c_long_double im;
+}
+
+version (all) // bug to test
+{
+ enum __c_complex_real : _Complex;
+ alias c_complex_real = __c_complex_real;
+}
+else // works
+ enum c_complex_real : _Complex;
+
+c_complex_real toNative2(real re, real im)
+{
+ return c_complex_real(re, im);
+}
+
+void main()
+{
+ c_complex_real n = toNative2(123, 456);
+ assert(123 == n.re && 456 == n.im);
+}