]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* g++.dg/other/complex1.C: New test.
authorWolfgang Bangerth <bangerth@dealii.com>
Thu, 16 Dec 2004 10:16:24 +0000 (10:16 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Thu, 16 Dec 2004 10:16:24 +0000 (10:16 +0000)
From-SVN: r92254

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/other/complex1.C [new file with mode: 0644]

index 06dd868513a0b0e76744019f3ef2c9f114c65d66..c70c5262714711ddb84e6a36104a61bdadea859a 100644 (file)
@@ -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 (file)
index 0000000..5c03514
--- /dev/null
@@ -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;
+}