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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [builtins-54.c] - Blame information for rev 853

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* { dg-do link } */
2
/* { dg-options "-O2 -ffast-math" } */
3
 
4
double cabs(__complex__ double);
5
float cabsf(__complex__ float);
6
long double cabsl(__complex__ long double);
7
 
8
void link_error (void);
9
 
10
void test(__complex__ double x)
11
{
12
  if (cabs(x) != cabs(-x))
13
    link_error();
14
 
15
  if (cabs(x) != cabs(~x))
16
    link_error();
17
}
18
 
19
void testf(__complex__ float x)
20
{
21
  if (cabsf(x) != cabsf(-x))
22
    link_error();
23
 
24
  if (cabsf(x) != cabsf(~x))
25
    link_error();
26
}
27
 
28
void testl(__complex__ long double x)
29
{
30
  if (cabsl(x) != cabsl(-x))
31
    link_error();
32
 
33
  if (cabsl(x) != cabsl(~x))
34
    link_error();
35
}
36
 
37
int main()
38
{
39
  test(0.0);
40
  testf(0.0);
41
  testl(0.0);
42
  return 0;
43
}
44
 

powered by: WebSVN 2.1.0

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