i386, testsuite: Fix non-Unicode character
[official-gcc.git] / gcc / testsuite / c-c++-common / gomp / imperfect5.c
blobda92578ed25285dc47ceadfcfafc9c6dbb6840fb
1 /* { dg-do compile } */
3 /* This test case is expected to fail due to errors. */
5 #define N 30
6 #define M 3
8 int a[N][M], b[N][M], c[N][M];
10 extern void dostuff (int, int);
12 /* good1 and good2 should compile without error. */
13 void
14 good1 (void)
16 int x, shift;
18 x = 0;
19 #pragma omp parallel for simd collapse(2) reduction(inscan,+: x) private(shift)
20 for (int i = 0; i < N; i++)
22 for (int j = 0; j < M; j++)
24 x += a[i][j];
25 x += b[i][j];
26 #pragma omp scan inclusive(x)
27 shift = i + 29*j;
28 c[i][j] = x + shift;
33 void
34 good2 (void)
36 int x, shift;
37 x = 0;
39 #pragma omp parallel for simd collapse(2) reduction(inscan,+: x) private(shift)
40 for (int i = 0; i < N; i++)
42 for (int j = 0; j < M; j++)
44 shift = i + 29*j;
45 c[i][j] = x + shift;
46 #pragma omp scan exclusive(x)
47 x += a[i][j];
48 x += b[i][j];
53 /* Adding intervening code should trigger an error. */
55 void
56 bad1 (void)
58 int x, shift;
60 x = 0;
61 #pragma omp parallel for simd collapse(2) reduction(inscan,+: x) private(shift)
62 for (int i = 0; i < N; i++) /* { dg-error "inner loops must be perfectly nested" } */
64 dostuff (i, 0);
65 for (int j = 0; j < M; j++)
67 x += a[i][j];
68 x += b[i][j];
69 #pragma omp scan inclusive(x)
70 shift = i + 29*j;
71 c[i][j] = x + shift;
76 void
77 bad2 (void)
79 int x, shift;
80 x = 0;
82 #pragma omp parallel for simd collapse(2) reduction(inscan,+: x) private(shift)
83 for (int i = 0; i < N; i++) /* { dg-error "inner loops must be perfectly nested" } */
85 for (int j = 0; j < M; j++)
87 shift = i + 29*j;
88 c[i][j] = x + shift;
89 #pragma omp scan exclusive(x)
90 x += a[i][j];
91 x += b[i][j];
93 dostuff (i, 1);