Merged with mainline at revision 126347.
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / 20020523-2.c
blob06d33d87ef26eb47dd1e285cadfe67625d21223d
1 /* PR target/6753
2 This testcase was miscompiled because sse_mov?fcc_const0*
3 patterns were missing earlyclobber. */
4 /* { dg-do run { target i?86-*-* x86_64-*-* } } */
5 /* { dg-require-effective-target ilp32 } */
6 /* { dg-options "-march=pentium3 -msse -ffast-math -O2" } */
8 #include "../../gcc.dg/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);