FSF GCC merge 02/23/03
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.brendan / complex1.C
blob0e3f4f6f685b990a2993dc4d0a9c9616ecb5d33e
1 // Special g++ Options:
3 // This test makes sure that the stuff in lex.c (real_yylex) is
4 // set up to handle real and imag numbers correctly.  This test is against
5 // a bug where the compiler was not converting the integer `90' to a
6 // complex number, unless you did `90.0'.  Fixed 10/1/1997.
8 extern "C" {
9 int printf (const char *, ...);
10 void exit (int);
11 void abort (void);
14 __complex__ double cd;
16 int one = 1;
18 int
19 main()
21   cd = 1.0+90i;
22   cd *= one;
24   if (__real__ cd != 1 || __imag__ cd != 90)
25     abort ();
27   exit (0);