OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [libgomp/] [testsuite/] [libgomp.c/] [atomic-5.c] - Blame information for rev 280

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 273 jeremybenn
/* PR middle-end/36106 */
2
/* { dg-options "-O2" } */
3
/* { dg-options "-O2 -mcx16" { target { { i?86-*-* x86_64-*-* } && lp64 } } } */
4
 
5
#ifdef __x86_64__
6
# include "cpuid.h"
7
#endif
8
 
9
extern void abort (void);
10
 
11
int __attribute__((noinline))
12
do_test (void)
13
{
14
  long double d = .0L;
15
  int i;
16
  #pragma omp parallel for shared (d)
17
    for (i = 0; i < 10; i++)
18
      #pragma omp atomic
19
        d += 1.0L;
20
  if (d != 10.0L)
21
    abort ();
22
  return 0;
23
}
24
 
25
int
26
main (void)
27
{
28
#ifdef __x86_64__
29
  unsigned int eax, ebx, ecx, edx;
30
 
31
  if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx))
32
    return 0;
33
 
34
  if (!(ecx & bit_CMPXCHG16B))
35
    return 0;
36
#endif
37
 
38
  do_test ();
39
 
40
  return 0;
41
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.