From df62c1c110e8532b995b23540b7e3695729c0779 Mon Sep 17 00:00:00 2001 From: Jing Yu Date: Thu, 5 Nov 2009 15:11:04 -0800 Subject: Check in gcc sources for prebuilt toolchains in Eclair. --- gcc-4.4.0/libgomp/testsuite/libgomp.c/atomic-2.c | 37 ++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 gcc-4.4.0/libgomp/testsuite/libgomp.c/atomic-2.c (limited to 'gcc-4.4.0/libgomp/testsuite/libgomp.c/atomic-2.c') diff --git a/gcc-4.4.0/libgomp/testsuite/libgomp.c/atomic-2.c b/gcc-4.4.0/libgomp/testsuite/libgomp.c/atomic-2.c new file mode 100644 index 000000000..c8779483b --- /dev/null +++ b/gcc-4.4.0/libgomp/testsuite/libgomp.c/atomic-2.c @@ -0,0 +1,37 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -mcx16" { target { { i?86-*-* x86_64-*-* } && lp64 } } } */ + +#ifdef __x86_64__ +#include "cpuid.h" +#endif + +double d = 1.5; +long double ld = 3; +extern void abort (void); + +void +test (void) +{ +#pragma omp atomic + d *= 1.25; +#pragma omp atomic + ld /= 0.75; + if (d != 1.875 || ld != 4.0L) + abort (); +} + +int +main (void) +{ +#ifdef __x86_64__ + unsigned int eax, ebx, ecx, edx; + + if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx)) + return 0; + + if (!(ecx & bit_CMPXCHG16B)) + return 0; +#endif + test (); + return 0; +} -- cgit v1.2.3