OSDN Git Service

Scan "lea\[lq\]?\[ \t\]" instead of "lea\[ \t\]".
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.target / i386 / brokensqrt.c
1 /* { dg-do run } */
2 /* { dg-options "-O2 -ffast-math -msse -mfpmath=sse -mrecip" } */
3 #include "sse-check.h"
4
5 extern float sqrtf (float);
6 float __attribute__((noinline)) broken (float a, float b)
7 {
8   return sqrtf (a / b);
9 }
10
11 extern void abort (void);
12 extern void *memcpy (void *, const void *, __SIZE_TYPE__);
13 static void
14 sse_test (void)
15 {
16   int i;
17   float x;
18   char buf[sizeof (float)];
19   x = broken (0.0f, 10000.0f);
20   /* A convoluted way to check for the correct result (zero) for all
21      floating point formats.
22      We can't use ==, !=, or range checks, or isinf/isnan/isunordered,
23      because all of these will not do the right thing under -ffast-math,
24      as they can assume that neither nan nor inf are returned.  */
25   memcpy (&buf, &x, sizeof (float));
26   for (i = 0; i < sizeof (float); i++)
27     if (buf[i] != 0)
28       abort ();
29 }