Merge from mainline (gomp-merge-2005-02-26).
[official-gcc.git] / gcc / testsuite / gcc.dg / 20020523-2.c
blob086f1d469e66117ab451012e93078a235024e105
1 /* PR target/6753
2 This testcase was miscompiled because sse_mov?fcc_const0*
3 patterns were missing earlyclobber. */
4 /* { dg-do run { target i386-*-* } } */
5 /* { dg-skip-if "" { i?86-*-* } { "-m64" } { "" } } */
6 /* { dg-options "-march=pentium3 -msse -ffast-math -O2" } */
8 #include "i386-cpuid.h"
9 extern void abort (void);
10 extern void exit (int);
12 float one = 1.f;
14 void bar (float f)
16 if (__builtin_memcmp (&one, &f, sizeof (float)))
17 abort ();
20 float foo (void)
22 return 1.f;
25 typedef struct
27 float t;
28 } T;
30 void bail_if_no_sse (void)
32 unsigned int edx;
33 /* See if capabilities include SSE (25th bit; 26 for SSE2). */
34 edx = i386_cpuid();
35 if (!(edx & bit_SSE))
36 exit (0);
39 int main (void)
41 int i;
42 T x[1];
44 bail_if_no_sse ();
45 for (i = 0; i < 1; i++)
47 x[i].t = foo ();
48 x[i].t = 0.f > x[i].t ? 0.f : x[i].t;
49 bar (x[i].t);
52 exit (0);