OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [c-c++-common/] [torture/] [complex-alias-1.c] - Blame information for rev 686

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 686 jeremybenn
/* Accesses to complex numbers were sometimes marked as scalar and
2
   sometimes as struct accesses.  */
3
/* { dg-do run } */
4
/* { dg-options "-std=c99" { target c } } */
5
 
6
#ifdef __cplusplus
7
extern "C" {
8
#endif
9
extern void abort (void);
10
#ifdef __cplusplus
11
}
12
#endif
13
static double _Complex *fp_cxd(double _Complex *cx) {
14
  return cx;
15
}
16
 
17
int main( ) {
18
  double _Complex cx = 4.0 + 3.0*(__extension__ 1.0iF);
19
  double _Complex cx43 = 4.0 + 3.0*(__extension__ 1.0iF);
20
  double _Complex cx11 = 1.0 + 1.0*(__extension__ 1.0iF);
21
 
22
  *fp_cxd(&cx) *= cx11;
23
  *fp_cxd(&cx) /= cx11;
24
 
25
  double r_cx = __real__(cx);
26
  double i_cx = __imag__(cx);
27
  double r_cx43 = __real__(cx43);
28
  double i_cx43 = __imag__(cx43);
29
 
30
  if( (r_cx == r_cx43) && (i_cx == i_cx43) ) {
31
    return 0;
32
  } else {
33
    abort ();
34
  }
35
}

powered by: WebSVN 2.1.0

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