1 // RUN: %clang_cc1 %s -fopenacc -verify
3 typedef struct IsComplete
{
4 struct S
{ int A
; } CompositeMember
;
9 void uses(int IntParam
, short *PointerParam
, float ArrayParam
[5], Complete CompositeParam
) {
13 Complete LocalComposite
;
14 // Check Appertainment:
15 #pragma acc parallel no_create(LocalInt)
17 #pragma acc serial no_create(LocalInt)
19 #pragma acc kernels no_create(LocalInt)
23 #pragma acc parallel no_create(LocalInt, LocalPointer, LocalArray)
25 #pragma acc parallel no_create(LocalArray[2:1])
28 #pragma acc parallel no_create(LocalComposite.ScalarMember, LocalComposite.ScalarMember)
31 // expected-error@+1{{OpenACC variable is not a valid variable name, sub-array, array element, member of a composite variable, or composite variable member}}
32 #pragma acc parallel no_create(1 + IntParam)
35 // expected-error@+1{{OpenACC variable is not a valid variable name, sub-array, array element, member of a composite variable, or composite variable member}}
36 #pragma acc parallel no_create(+IntParam)
39 // expected-error@+1{{OpenACC sub-array length is unspecified and cannot be inferred because the subscripted value is not an array}}
40 #pragma acc parallel no_create(PointerParam[2:])
43 // expected-error@+1{{OpenACC sub-array specified range [2:5] would be out of the range of the subscripted array size of 5}}
44 #pragma acc parallel no_create(ArrayParam[2:5])
47 // expected-error@+2{{OpenACC sub-array specified range [2:5] would be out of the range of the subscripted array size of 5}}
48 // expected-error@+1{{OpenACC variable is not a valid variable name, sub-array, array element, member of a composite variable, or composite variable member}}
49 #pragma acc parallel no_create((float*)ArrayParam[2:5])
51 // expected-error@+1{{OpenACC variable is not a valid variable name, sub-array, array element, member of a composite variable, or composite variable member}}
52 #pragma acc parallel no_create((float)ArrayParam[2])
55 // expected-error@+1{{OpenACC 'no_create' clause is not valid on 'loop' directive}}
56 #pragma acc loop no_create(LocalInt)