blob: 4cf5429c9bbf41454c33aaf1ed5896377e0af264 (
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
int test1()
{
int i, j, k, b[10];
int a[30];
double d;
float r;
i = 0;
#pragma acc loop
while(1) /* { dg-error "for statement expected" } */
{
if (i > 0) break;
i = i + 1;
}
i = 0;
#pragma acc loop
for(;;) /* { dg-error "expected iteration declaration or initialization" } */
{
if (i > 0) break; /* { dg-error "break statement used" } */
i = i + 1;
}
i = 0;
#pragma acc loop
do /* { dg-error "for statement expected" } */
{
i = i + 1;
}
while (i < 4);
#pragma acc loop
while (i < 8) /* { dg-error "for statement expected" } */
{
i = i + 1;
}
#pragma acc loop
for (d = 1; d < 30; d+= 6) /* { dg-error "invalid type for iteration variable" } */
{
i = d;
a[i] = 1;
}
#pragma acc loop /* { dg-error "loop directive must be associated with an OpenACC compute region" } */
for (i = 1; i < 30; i++ )
if (i == 16) break; /* { dg-error "break statement used" } */
/* different types of for loop are allowed */
#pragma acc loop /* { dg-error "loop directive must be associated with an OpenACC compute region" } */
for (i = 1; i < 10; i++)
{
}
#pragma acc loop /* { dg-error "loop directive must be associated with an OpenACC compute region" } */
for (i = 1; i < 10; i+=2)
{
a[i] = i;
}
/* after loop directive must be loop */
#pragma acc loop
a[1] = 1; /* { dg-error "for statement expected" } */
for (i = 1; i < 10; i++)
;
/* combined directives may be used*/
#pragma acc parallel loop
for(i = 1; i < 10; i++)
{
}
#pragma acc kernels loop
for(i = 1; i < 10; i++)
{
}
return 0;
}
// PR64765
void PR64765(float *f, double *r) {
int i;
#pragma acc kernels loop create(f) copy(r)
for(i = 64; i < 76; i += 5) {}
}
|