diff options
Diffstat (limited to 'gcc-4.9/gcc/testsuite/c-c++-common/tm/omp.c')
-rw-r--r-- | gcc-4.9/gcc/testsuite/c-c++-common/tm/omp.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/c-c++-common/tm/omp.c b/gcc-4.9/gcc/testsuite/c-c++-common/tm/omp.c new file mode 100644 index 000000000..b664a6f11 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/c-c++-common/tm/omp.c @@ -0,0 +1,23 @@ +/* { dg-do compile } */ +/* { dg-options "-fgnu-tm -fopenmp" } */ +/* { dg-require-effective-target pthread } */ + +__attribute__ ((transaction_pure)) +unsigned long rdtsc(); + +typedef struct ENTER_EXIT_TIMES +{ + unsigned long enter; +} times_t; + +void ParClassify() +{ + void * Parent; +#pragma omp parallel private(Parent) + { + times_t inside; + __transaction_atomic { + inside.enter = rdtsc(); + } + } +} |