blob: e92d9762931f4e52523ac88afd4af408a3092d97 (
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
|
/* PR middle-end/35196 */
/* { dg-do run } */
extern void abort (void);
extern void omp_set_dynamic (int);
int
main (void)
{
int i, j;
omp_set_dynamic (0);
#pragma omp parallel for lastprivate (i, j) num_threads (8) schedule (static)
for (i = 0; i < 5; i++)
j = i;
if (i != 5 || j != 4)
abort ();
#pragma omp parallel for lastprivate (i, j) num_threads (8) schedule (static, 2)
for (i = 0; i < 5; i++)
j = i;
if (i != 5 || j != 4)
abort ();
#pragma omp parallel for lastprivate (i, j) num_threads (8) schedule (dynamic)
for (i = 0; i < 5; i++)
j = i;
if (i != 5 || j != 4)
abort ();
#pragma omp parallel for lastprivate (i, j) num_threads (8) schedule (static)
for (i = -12; i < 21; i += 3)
j = i;
if (i != 21 || j != 18)
abort ();
#pragma omp parallel for lastprivate (i, j) num_threads (8) schedule (static, 2)
for (i = -12; i < 21; i += 3)
j = i;
if (i != 21 || j != 18)
abort ();
#pragma omp parallel for lastprivate (i, j) num_threads (8) schedule (dynamic, 3)
for (i = -12; i < 21; i += 3)
j = i;
if (i != 21 || j != 18)
abort ();
return 0;
}
|