You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: clang/test/SemaOpenACC/data-construct-deviceptr-clause.c
+13-15Lines changed: 13 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -14,57 +14,55 @@ void uses() {
14
14
15
15
// expected-error@+1{{expected pointer in 'deviceptr' clause, type is 'int'}}
16
16
#pragma acc data default(none) deviceptr(LocalInt)
17
-
for (inti=0; i<5; ++i);
17
+
;
18
18
19
19
// expected-error@+1{{OpenACC variable is not a valid variable name, sub-array, array element, member of a composite variable, or composite variable member}}
20
20
#pragma acc data default(none) deviceptr(&LocalInt)
21
-
for (inti=0; i<5; ++i);
21
+
;
22
22
23
23
24
24
// expected-error@+1{{expected pointer in 'deviceptr' clause, type is 'int[5]'}}
25
-
#pragma acc kernels loop deviceptr(Array)
26
-
for (inti=0; i<5; ++i);
25
+
#pragma acc data default(none) deviceptr(Array)
26
+
;
27
27
28
28
// expected-error@+1{{expected pointer in 'deviceptr' clause, type is 'int'}}
29
29
#pragma acc data default(none) deviceptr(Array[0])
30
-
for (inti=0; i<5; ++i);
30
+
;
31
31
32
32
// expected-error@+2{{OpenACC sub-array is not allowed here}}
33
33
// expected-note@+1{{expected variable of pointer type}}
34
34
#pragma acc data default(none) deviceptr(Array[0:1])
35
-
for (inti=0; i<5; ++i);
35
+
;
36
36
37
37
// expected-error@+1{{expected pointer in 'deviceptr' clause, type is 'int *[5]'}}
38
38
#pragma acc data default(none) deviceptr(PtrArray)
39
-
for (inti=0; i<5; ++i);
39
+
;
40
40
41
41
#pragma acc data default(none) deviceptr(PtrArray[0])
42
-
for (inti=0; i<5; ++i);
42
+
;
43
43
44
44
// expected-error@+2{{OpenACC sub-array is not allowed here}}
45
45
// expected-note@+1{{expected variable of pointer type}}
46
46
#pragma acc data default(none) deviceptr(PtrArray[0:1])
47
-
for (inti=0; i<5; ++i);
47
+
;
48
48
49
49
// expected-error@+1{{expected pointer in 'deviceptr' clause, type is 'struct S'}}
50
50
#pragma acc data default(none) deviceptr(s)
51
-
for (inti=0; i<5; ++i);
51
+
;
52
52
53
53
// expected-error@+1{{expected pointer in 'deviceptr' clause, type is 'int'}}
54
54
#pragma acc data default(none) deviceptr(s.IntMem)
55
-
for (inti=0; i<5; ++i);
55
+
;
56
56
57
57
#pragma acc data default(none) deviceptr(s.PtrMem)
58
-
for (inti=0; i<5; ++i);
58
+
;
59
59
60
60
// expected-error@+1{{OpenACC 'deviceptr' clause is not valid on 'enter data' directive}}
61
61
#pragma acc enter data copyin(LocalInt) deviceptr(LocalInt)
62
-
for(inti=5; i<10;++i);
63
62
// expected-error@+1{{OpenACC 'deviceptr' clause is not valid on 'exit data' directive}}
64
63
#pragma acc exit data copyout(LocalInt) deviceptr(LocalInt)
65
-
for(inti=5; i<10;++i);
66
64
// expected-warning@+2{{OpenACC clause 'use_device' not yet implemented}}
67
65
// expected-error@+1{{OpenACC 'deviceptr' clause is not valid on 'host_data' directive}}
0 commit comments