Debian Codegraph @

gcc/testsuite/g++.old-deja/g++.brendan/complex1.C

raw
1 // { dg-do run }
2 // { dg-options "" }
3
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.
8
9 extern "C" {
10 int printf (const char *, ...);
11 void exit (int);
12 void abort (void);
13 }
14
15 __complex__ double cd;
16
17 int one = 1;
18
19 int
20 main()
21 {
22 cd = 1.0+90i;
23 cd *= one;
24
25 if (__real__ cd != 1 || __imag__ cd != 90)
26 abort ();
27
28 exit (0);
29 }