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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libgomp/] [testsuite/] [libgomp.c/] [atomic-2.c] - Blame information for rev 791

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

Line No. Rev Author Line
1 735 jeremybenn
/* { dg-do run } */
2
/* { dg-options "-O2 -mcx16" { target { { i?86-*-* x86_64-*-* } && lp64 } } } */
3
 
4
#ifdef __x86_64__
5
#include "cpuid.h"
6
#endif
7
 
8
double d = 1.5;
9
long double ld = 3;
10
extern void abort (void);
11
 
12
void
13
test (void)
14
{
15
#pragma omp atomic
16
  d *= 1.25;
17
#pragma omp atomic
18
  ld /= 0.75;
19
  if (d != 1.875 || ld != 4.0L)
20
    abort ();
21
}
22
 
23
int
24
main (void)
25
{
26
#ifdef __x86_64__
27
  unsigned int eax, ebx, ecx, edx;
28
 
29
  if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx))
30
    return 0;
31
 
32
  if (!(ecx & bit_CMPXCHG16B))
33
    return 0;
34
#endif
35
  test ();
36
  return 0;
37
}

powered by: WebSVN 2.1.0

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