testsuite/libgomp.c/atomic-6.c

Go to the documentation of this file.
00001 /* PR middle-end/36106 */
00002 /* { dg-options "-O2" } */
00003 /* { dg-options "-O2 -mieee" { target alpha*-*-* } } */
00004 /* { dg-options "-O2 -march=i586" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
00005 
00006 #ifdef __i386__
00007 # include "cpuid.h"
00008 #endif
00009 
00010 extern void abort (void);
00011 
00012 union { unsigned long long l; double d; } u = { .l = 0x7ff0000000072301ULL };
00013 
00014 int __attribute__((noinline))
00015 do_test (void)
00016 {
00017 #pragma omp atomic
00018   u.d += 1.0L;
00019   return 0;
00020 }
00021 
00022 int
00023 main (void)
00024 {
00025 #ifdef __i386__
00026   unsigned int eax, ebx, ecx, edx;
00027 
00028   if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx))
00029     return 0;
00030 
00031   if (!(edx & bit_CMPXCHG8B))
00032     return 0;
00033 #endif
00034 
00035   do_test ();
00036 
00037   return 0;
00038 }

Generated on Fri Apr 5 05:38:10 2013 for Libgomp by  doxygen 1.4.7