aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorWolfgang Bangerth <bangerth@dealii.com>2004-12-16 10:16:24 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2004-12-16 10:16:24 +0000
commit0c0cce420e1ced4cfd4e6daddb91e3f6b548bf29 (patch)
tree6004481299dfefa98e2e9af3ec0845733180fc2d /gcc
parent53371c33287e1fa7d75dfebe1522ec5299d9142d (diff)
downloadgcc-0c0cce420e1ced4cfd4e6daddb91e3f6b548bf29.zip
gcc-0c0cce420e1ced4cfd4e6daddb91e3f6b548bf29.tar.gz
gcc-0c0cce420e1ced4cfd4e6daddb91e3f6b548bf29.tar.bz2
* g++.dg/other/complex1.C: New test.
From-SVN: r92254
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/g++.dg/other/complex1.C28
2 files changed, 32 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 06dd868..c70c526 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2004-12-16 Wolfgang Bangerth <bangerth@dealii.com>
+
+ * g++.dg/other/complex1.C: New test.
+
2004-12-15 Alan Modra <amodra@bigpond.net.au>
* g++.dg/opt/inline9.C: New test.
diff --git a/gcc/testsuite/g++.dg/other/complex1.C b/gcc/testsuite/g++.dg/other/complex1.C
new file mode 100644
index 0000000..5c03514
--- /dev/null
+++ b/gcc/testsuite/g++.dg/other/complex1.C
@@ -0,0 +1,28 @@
+// PR middle-end/18882
+// Origin: Petr Mikulik <mikulik@physics.muni.cz>
+// Testcase by Wolfgang Bangerth <bangerth@dealii.com>
+
+// { dg-do run }
+// { dg-options "" }
+
+extern "C" void abort ();
+
+struct C {
+ __complex__ long double c;
+};
+
+void foo()
+{
+ C x = {2+2i};
+
+ int n = 1;
+ C y = (n==1) ? x : (C){3+3i};
+ if (__imag__ y.c != 2)
+ abort ();
+}
+
+int main(void)
+{
+ foo ();
+ return 0;
+}