diff options
author | Ian Lance Taylor <iant@golang.org> | 2023-06-26 09:57:21 -0700 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2023-06-26 09:57:21 -0700 |
commit | aa1e672b5d99102b03eb5fb9c51609c45f62bff7 (patch) | |
tree | 886212591b1c9d127eaaf234a4a2e22452ea384a /gcc/testsuite/gdc.test/runnable | |
parent | 97e31a0a2a2d2273687fcdb4e5416aab1a2186e1 (diff) | |
parent | 3a39a31b8ae9c6465434aefa657f7fcc86f905c0 (diff) | |
download | gcc-devel/gccgo.zip gcc-devel/gccgo.tar.gz gcc-devel/gccgo.tar.bz2 |
Merge from trunk revision 3a39a31b8ae9c6465434aefa657f7fcc86f905c0.devel/gccgo
Diffstat (limited to 'gcc/testsuite/gdc.test/runnable')
-rw-r--r-- | gcc/testsuite/gdc.test/runnable/complex3.d | 31 |
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); +} |