[Flang] remove whole-archive option for AIX linker (#76039)
[llvm-project.git] / clang / test / ParserOpenACC / parse-cache-construct.cpp
blob3b2230cabae32fd0824708b53bcdfee4d87a2428
1 // RUN: %clang_cc1 %s -verify -fopenacc
3 namespace NS {
4 static char* NSArray;// expected-note{{declared here}}
5 static int NSInt;// expected-note 2{{declared here}}
7 char *getArrayPtr();
8 template<typename T, int I>
9 void func() {
10 char *ArrayPtr = getArrayPtr();
11 for (int i = 0; i < 10; ++i) {
12 // expected-warning@+1{{OpenACC directives not yet implemented, pragma ignored}}
13 #pragma acc cache(ArrayPtr[T::value + I:I + 5], T::array[(i + T::value, 5): 6])
15 for (int i = 0; i < 10; ++i) {
16 // expected-warning@+1{{OpenACC directives not yet implemented, pragma ignored}}
17 #pragma acc cache(NS::NSArray[NS::NSInt])
20 for (int i = 0; i < 10; ++i) {
21 // expected-warning@+1{{OpenACC directives not yet implemented, pragma ignored}}
22 #pragma acc cache(NS::NSArray[NS::NSInt : NS::NSInt])
25 for (int i = 0; i < 10; ++i) {
26 // expected-error@+2{{use of undeclared identifier 'NSArray'; did you mean 'NS::NSArray'}}
27 // expected-warning@+1{{OpenACC directives not yet implemented, pragma ignored}}
28 #pragma acc cache(NSArray[NS::NSInt : NS::NSInt])
31 for (int i = 0; i < 10; ++i) {
32 // expected-error@+2{{use of undeclared identifier 'NSInt'; did you mean 'NS::NSInt'}}
33 // expected-warning@+1{{OpenACC directives not yet implemented, pragma ignored}}
34 #pragma acc cache(NS::NSArray[NSInt : NS::NSInt])
37 for (int i = 0; i < 10; ++i) {
38 // expected-error@+2{{use of undeclared identifier 'NSInt'; did you mean 'NS::NSInt'}}
39 // expected-warning@+1{{OpenACC directives not yet implemented, pragma ignored}}
40 #pragma acc cache(NS::NSArray[NS::NSInt : NSInt])
44 struct S {
45 static constexpr int value = 5;
46 static constexpr char array[] ={1,2,3,4,5};
49 void use() {
50 func<S, 5>();