comparison libgomp/testsuite/libgomp.c/atomic-6.c @ 0:a06113de4d67

first commit
author kent <kent@cr.ie.u-ryukyu.ac.jp>
date Fri, 17 Jul 2009 14:47:48 +0900
parents
children 04ced10e8804
comparison
equal deleted inserted replaced
-1:000000000000 0:a06113de4d67
1 /* PR middle-end/36106 */
2 /* { dg-options "-O2" } */
3 /* { dg-options "-O2 -mieee" { target alpha*-*-* } } */
4 /* { dg-options "-O2 -march=i586" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
5
6 #ifdef __i386__
7 # include "cpuid.h"
8 #endif
9
10 extern void abort (void);
11
12 union { unsigned long long l; double d; } u = { .l = 0x7ff0000000072301ULL };
13
14 int __attribute__((noinline))
15 do_test (void)
16 {
17 #pragma omp atomic
18 u.d += 1.0L;
19 return 0;
20 }
21
22 int
23 main (void)
24 {
25 #ifdef __i386__
26 unsigned int eax, ebx, ecx, edx;
27
28 if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx))
29 return 0;
30
31 if (!(edx & bit_CMPXCHG8B))
32 return 0;
33 #endif
34
35 do_test ();
36
37 return 0;
38 }