| 1 |
/* { dg-do run { target { *-*-linux* && { ! ia32 } } } }*/ |
| 2 |
/* { dg-require-effective-target raoint }*/ |
| 3 |
/* { dg-options "-pthread -O2 -mraoint" }*/ |
| 4 |
#include "rao-helper.h" |
| 5 |
|
| 6 |
const unsigned int num_iters= 1000000; |
| 7 |
unsigned int thread_val[4] = { 0x5a, 0x9600, 0x730000, 0xce000000 }; |
| 8 |
static long long shared_val = 0; |
| 9 |
unsigned int expected_val = 0xce73965a; |
| 10 |
|
| 11 |
static void* |
| 12 |
threads_worker (state_t *tstate) |
| 13 |
{ |
| 14 |
int i; |
| 15 |
unsigned int val = thread_val[tstate->id]; |
| 16 |
for (i = 0; i < num_iters; i++) |
| 17 |
_aor_i64 (&shared_val, val); |
| 18 |
} |
| 19 |
|
| 20 |
static void |
| 21 |
rao_test (void) |
| 22 |
{ |
| 23 |
if (shared_val != expected_val) |
| 24 |
abort (); |
| 25 |
} |