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

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [builtins-43.c] - Blame information for rev 298

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-O1 -fno-trapping-math -fno-finite-math-only -fdump-tree-gimple -fdump-tree-optimized" } */
3
 
4
extern void f(int);
5
extern void link_error ();
6
 
7
extern float x;
8
extern double y;
9
extern long double z;
10
 
11
int
12
main ()
13
{
14
  double nan = __builtin_nan ("");
15
#ifndef __SPU__
16
  /* The SPU single-precision floating point format does not support NANs.  */
17
  float nanf = __builtin_nanf ("");
18
#endif
19
  long double nanl = __builtin_nanl ("");
20
 
21
  if (!__builtin_isnan (nan))
22
    link_error ();
23
#ifndef __SPU__
24
  if (!__builtin_isnan (nanf))
25
    link_error ();
26
  if (!__builtin_isnanf (nanf))
27
    link_error ();
28
#endif
29
  if (!__builtin_isnan (nanl))
30
    link_error ();
31
  if (!__builtin_isnanl (nanl))
32
    link_error ();
33
 
34
  if (__builtin_isnan (4.0))
35
    link_error ();
36
  if (__builtin_isnan (4.0))
37
    link_error ();
38
  if (__builtin_isnanf (4.0))
39
    link_error ();
40
  if (__builtin_isnan (4.0))
41
    link_error ();
42
  if (__builtin_isnanl (4.0))
43
    link_error ();
44
 
45
  f (__builtin_isnan (x));
46
  f (__builtin_isnan (y));
47
  f (__builtin_isnanf (y));
48
  f (__builtin_isnan (z));
49
  f (__builtin_isnanl (z));
50
}
51
 
52
 
53
/* Check that all instances of __builtin_isnan were folded.  */
54
/* { dg-final { scan-tree-dump-times "isnan" 0 "gimple" } } */
55
/* { dg-final { cleanup-tree-dump "gimple" } } */
56
 
57
/* Check that all instances of link_error were subject to DCE.  */
58
/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized" } } */
59
/* { dg-final { cleanup-tree-dump "optimized" } } */

powered by: WebSVN 2.1.0

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