2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / gcc.dg / 20030225-2.c
bloba21660de71ff482764ceb83b6c06f4026093b33d
1 /* { dg-do run { target ia64-*-linux* } } */
2 /* { dg-options "-O3" } */
4 int __attribute__((noinline, const))
5 ret4 (float value)
7 return 4;
10 int __attribute__((noinline, const))
11 ret0 (float value)
13 return 0;
16 float __attribute__((noinline))
17 test (float x, float y)
19 int clsx = ret4 (x);
20 int clsy = ret0 (y);
22 if (clsx == 0 || clsy == 0
23 || (y < 0 && clsx == 1 && clsy == 1))
24 return x - y;
26 return x < y ? 0 : x - y;
29 float a = 0.0, b;
31 int main (void)
33 unsigned long e;
34 b = a / a;
35 __asm__ __volatile__ ("mov.m %0=ar.fpsr" : "=r" (e));
36 e &= ~0x7e000UL;
37 __asm__ __volatile__ ("mov.m ar.fpsr=%0" :: "r" (e) : "memory");
38 a = test (0, b);
39 __asm__ __volatile__ ("mov.m %0=ar.fpsr" : "=r" (e));
40 if (e & 0x2000)
41 abort ();
42 exit (0);