summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/gomp/pr53992.c
blob: 4d5af3ce785577f13cddb655a0989d21cb30cd8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* PR middle-end/53992 */
/* { dg-do compile } */
/* { dg-options "-fgnu-tm -fopenmp" } */
/* { dg-require-effective-target fgnu_tm } */

int main() {
    long data[10000];
    long i, min=10000;
    for (i=0; i<10000; i++) data[i] = -i;
            
#pragma omp parallel for
    for (i=0; i<10000; i++) {
        __transaction_atomic
        {
            if (data[i] < min)
                min = data[i];
        }
    }

    return !(min == -9999);
}