Debian Codegraph @

gcc/testsuite/c-c++-common/gomp/imperfect-legacy-syntax.c

raw
1 /* { dg-do compile } */
2
3 /* Braces may enclose a nested FOR even when intervening code is not
4 permitted. Before GCC implemented OpenMP 5.1 canonical loop syntax
5 and support for intervening code, it used to ignore empty statements
6 instead of treating them as intervening code; as an extension, those
7 are still accepted without complaint even in constructs where intervening
8 code is not supposed to be valid. */
9
10 void s1 (int a1, int a2, int a3)
11 {
12 int i, j, k;
13
14 #pragma omp for ordered(3)
15 for (i = 0; i < a1; i++)
16 {
17 for (j = 0; j < a2; j++)
18 {
19 for (k = 0; k < a3; k++)
20 {
21 }
22 }
23 }
24 }
25
26 void s2 (int a1, int a2, int a3)
27 {
28 int i, j, k;
29
30 #pragma omp for ordered(3)
31 for (i = 0; i < a1; i++)
32 {
33 ;
34 for (j = 0; j < a2; j++)
35 {
36 ;
37 for (k = 0; k < a3; k++)
38 {
39 }
40 ;
41 }
42 ;
43 }
44 }