Merge from mainline (gomp-merge-2005-02-26).
[official-gcc.git] / gcc / testsuite / gcc.dg / 20030225-2.c
blobfd83ab8e0aa46fa812099c5084a91bc758ce17c8
1 /* { dg-do run { target ia64-*-linux* } } */
2 /* { dg-options "-O3" } */
4 extern void abort (void);
5 extern void exit (int);
7 int __attribute__((noinline, const))
8 ret4 (float value)
10 return 4;
13 int __attribute__((noinline, const))
14 ret0 (float value)
16 return 0;
19 float __attribute__((noinline))
20 test (float x, float y)
22 int clsx = ret4 (x);
23 int clsy = ret0 (y);
25 if (clsx == 0 || clsy == 0
26 || (y < 0 && clsx == 1 && clsy == 1))
27 return x - y;
29 return x < y ? 0 : x - y;
32 float a = 0.0, b;
34 int main (void)
36 unsigned long e;
37 b = a / a;
38 __asm__ __volatile__ ("mov.m %0=ar.fpsr" : "=r" (e));
39 e &= ~0x7e000UL;
40 __asm__ __volatile__ ("mov.m ar.fpsr=%0" :: "r" (e) : "memory");
41 a = test (0, b);
42 __asm__ __volatile__ ("mov.m %0=ar.fpsr" : "=r" (e));
43 if (e & 0x2000)
44 abort ();
45 exit (0);