Debian Codegraph @

libgomp/testsuite/libgomp.c/atomic-6.c

raw
1 /* PR middle-end/36106 */
2 /* { dg-additional-options "-mieee" { target alpha*-*-* } } */
3 /* { dg-additional-options "-march=i586" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
4
5 #ifdef __i386__
6 # include "cpuid.h"
7 #endif
8
9 extern void abort (void);
10
11 union { unsigned long long l; double d; } u = { .l = 0x7ff0000000072301ULL };
12
13 int __attribute__((noinline))
14 do_test (void)
15 {
16 #pragma omp atomic
17 u.d += 1.0L;
18 return 0;
19 }
20
21 int
22 main (void)
23 {
24 #ifdef __i386__
25 unsigned int eax, ebx, ecx, edx;
26
27 if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx))
28 return 0;
29
30 if (!(edx & bit_CMPXCHG8B))
31 return 0;
32 #endif
33
34 do_test ();
35
36 return 0;
37 }