OSDN Git Service

Backported from mainline
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / gomp / pr53992.c
1 /* PR middle-end/53992 */
2 /* { dg-do compile } */
3 /* { dg-options "-fgnu-tm -fopenmp" } */
4 /* { dg-require-effective-target fgnu_tm } */
5
6 int main() {
7     long data[10000];
8     long i, min=10000;
9     for (i=0; i<10000; i++) data[i] = -i;
10             
11 #pragma omp parallel for
12     for (i=0; i<10000; i++) {
13         __transaction_atomic
14         {
15             if (data[i] < min)
16                 min = data[i];
17         }
18     }
19
20     return !(min == -9999);
21 }