tree-optimization/115599 - reassoc qsort comparator issue
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.brendan / complex1.C
blob393941f8831e4457afcc7490fbd6d3499cb41efc
1 // { dg-do run  }
2 // { dg-options "" }
4 // This test makes sure that the stuff in lex.c (real_yylex) is
5 // set up to handle real and imag numbers correctly.  This test is against
6 // a bug where the compiler was not converting the integer `90' to a
7 // complex number, unless you did `90.0'.  Fixed 10/1/1997.
9 extern "C" {
10 int printf (const char *, ...);
11 void exit (int);
12 void abort (void);
15 __complex__ double cd;
17 int one = 1;
19 int
20 main()
22   cd = 1.0+90i;
23   cd *= one;
25   if (__real__ cd != 1 || __imag__ cd != 90)
26     abort ();
28   exit (0);