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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [libgomp/] [testsuite/] [libgomp.c/] [atomic-2.c] - Blame information for rev 867

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

Line No. Rev Author Line
1 38 julius
/* { dg-do run } */
2
/* { dg-options "-O2 -fopenmp" } */
3
/* { dg-options "-O2 -fopenmp -march=nocona" { target i?86-*-* x86_64-*-* } } */
4
/* { dg-options "-O2 -fopenmp" { target ilp32 } } */
5
 
6
double d = 1.5;
7
long double ld = 3;
8
extern void abort (void);
9
 
10
void
11
test (void)
12
{
13
#pragma omp atomic
14
  d *= 1.25;
15
#pragma omp atomic
16
  ld /= 0.75;
17
  if (d != 1.875 || ld != 4.0L)
18
    abort ();
19
}
20
 
21
int
22
main (void)
23
{
24
#ifdef __x86_64__
25
# define bit_SSE3 (1 << 0)
26
# define bit_CX16 (1 << 13)
27
  unsigned int ax, bx, cx, dx;
28
  __asm__ ("cpuid" : "=a" (ax), "=b" (bx), "=c" (cx), "=d" (dx)
29
           : "0" (1) : "cc");
30
  if ((cx & (bit_SSE3 | bit_CX16)) != (bit_SSE3 | bit_CX16))
31
    return 0;
32
#endif
33
  test ();
34
  return 0;
35
}

powered by: WebSVN 2.1.0

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