Debian Codegraph @

gcc/testsuite/c-c++-common/gomp/pr120052.c

raw
1 /* PR middle-end/120052 */
2 /* { dg-do compile } */
3 /* { dg-additional-options "-fsanitize=undefined" } */
4
5 void
6 foo (unsigned long s, long indx)
7 {
8 long counts[2][s];
9 #pragma omp parallel
10 #pragma omp masked
11 for (int i = 0; i < 2; i++)
12 counts[2][indx] = 1;
13 }
14
15 void
16 bar (unsigned long s, long indx)
17 {
18 long counts[2][s];
19 #pragma omp parallel shared(counts)
20 #pragma omp masked
21 for (int i = 0; i < 2; i++)
22 counts[2][indx] = 1;
23 }
24
25 void
26 baz (unsigned long s, long indx)
27 {
28 long counts[2][s];
29 #pragma omp parallel private(counts)
30 for (int i = 0; i < 2; i++)
31 counts[2][indx] = 1;
32 }