OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.brendan/] [complex1.C] - Blame information for rev 338

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 305 jeremybenn
// { 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
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.