OSDN Git Service

* gcc.gd/struct/wo_prof_global_var.c: Use uninitialized integer
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / pr37544.c
1 /* { dg-do run } */
2 /* { dg-options "-O2" } */
3 /* { dg-options "-O2 -msse2 -mtune=core2 -mfpmath=387" { target { i?86-*-* x86_64-*-* } } } */
4
5 #ifdef __i386__
6 #include "cpuid.h"
7 #endif
8
9 extern void abort (void);
10
11 int main(void)
12 {
13   double arr[1000];
14   double a, b;
15
16   int i;
17
18 #ifdef __i386__
19   unsigned int eax, ebx, ecx, edx;
20  
21   if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx))
22     return 0;
23
24   /* Run SSE2 test only if host has SSE2 support.  */
25   if (!(edx & bit_SSE2))
26     return 0;
27 #endif
28
29   for (i = 0; i < 1000; i++)
30     arr[i] = 4294967296.0 + (double)i;
31
32   a = arr[0];
33   b = (unsigned int)((unsigned long long int)a % 4294967296ULL);
34
35   if (b >= 4294967296.0)
36     abort ();
37
38   return 0;
39 }