| 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 inc_val = 3; |
| 7 |
const unsigned int num_iters= 1000000; |
| 8 |
static long long shared_val = 0; |
| 9 |
|
| 10 |
static |
| 11 |
void* threads_worker (state_t *tstate) |
| 12 |
{ |
| 13 |
int i; |
| 14 |
for (i = 0; i < num_iters; i++) |
| 15 |
_aadd_i64 (&shared_val, inc_val); |
| 16 |
return 0; |
| 17 |
} |
| 18 |
|
| 19 |
static void |
| 20 |
rao_test (void) |
| 21 |
{ |
| 22 |
if (shared_val != num_iters * num_threads * inc_val) |
| 23 |
abort (); |
| 24 |
} |