aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/gomp/imperfect-legacy-syntax.c
blob: 571e067091b7d6e6e82be7b0588c18d81617b51b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/* { dg-do compile } */

/* Braces may enclose a nested FOR even when intervening code is not
   permitted.  Before GCC implemented OpenMP 5.1 canonical loop syntax
   and support for intervening code, it used to ignore empty statements
   instead of treating them as intervening code; as an extension, those
   are still accepted without complaint even in constructs where intervening
   code is not supposed to be valid.  */

void s1 (int a1, int a2, int a3)
{
  int i, j, k;

#pragma omp for ordered(3)
  for (i = 0; i < a1; i++)
    {
      for (j = 0; j < a2; j++)
	{
	  for (k = 0; k < a3; k++)
	    {
	    }
	}
    }
}

void s2 (int a1, int a2, int a3)
{
  int i, j, k;

#pragma omp for ordered(3)
  for (i = 0; i < a1; i++)
    {
      ;
      for (j = 0; j < a2; j++)
	{
	  ;
	  for (k = 0; k < a3; k++)
	    {
	    }
	  ;
	}
      ;
    }
}