Revert "[llvm] Improve llvm.objectsize computation by computing GEP, alloca and mallo...
[llvm-project.git] / clang / test / ParserOpenACC / parse-clauses.cpp
blobdc985826a4efe9c309820a850fe3f45440c7a01e
1 // RUN: %clang_cc1 %s -verify -fopenacc
3 template<unsigned I, typename T>
4 void templ() {
5 #pragma acc loop collapse(I)
6 for(int i = 0; i < 5;++i)
7 for(int j = 0; j < 5; ++j)
8 for(int k = 0; k < 5; ++k)
9 for(int l = 0; l < 5; ++l)
10 for(int m = 0; m < 5; ++m)
11 for(int n = 0; n < 5; ++n)
12 for(int o = 0; o < 5; ++o);
14 #pragma acc loop collapse(T::value)
15 for(int i = 0;i < 5;++i)
16 for(int j = 0; j < 5; ++j)
17 for(int k = 0; k < 5; ++k)
18 for(int l = 0; l < 5; ++l)
19 for(int m = 0; m < 5;++m)
20 for(;;)
21 for(;;);
23 #pragma acc parallel vector_length(T::value)
24 for(;;){}
26 #pragma acc parallel vector_length(I)
27 for(;;){}
29 #pragma acc parallel async(T::value)
30 for(;;){}
32 #pragma acc parallel async(I)
33 for(;;){}
35 #pragma acc parallel async
36 for(;;){}
39 struct S {
40 static constexpr unsigned value = 5;
43 void use() {
44 templ<7, S>();
47 namespace NS {
48 void NSFunc();
50 class RecordTy { // #RecTy
51 static constexpr bool Value = false; // #VAL
52 void priv_mem_function(); // #PrivMemFun
53 public:
54 static constexpr bool ValuePub = true;
55 void mem_function();
57 template<typename T>
58 class TemplTy{};
59 void function();
63 // expected-warning@+2{{OpenACC clause 'bind' not yet implemented, clause ignored}}
64 // expected-warning@+1{{OpenACC construct 'routine' not yet implemented, pragma ignored}}
65 #pragma acc routine(use) bind(NS::NSFunc)
66 // expected-error@+3{{'RecordTy' does not refer to a value}}
67 // expected-note@#RecTy{{declared here}}
68 // expected-warning@+1{{OpenACC construct 'routine' not yet implemented, pragma ignored}}
69 #pragma acc routine(use) bind(NS::RecordTy)
70 // expected-error@+4{{'Value' is a private member of 'NS::RecordTy'}}
71 // expected-note@#VAL{{implicitly declared private here}}
72 // expected-warning@+2{{OpenACC clause 'bind' not yet implemented, clause ignored}}
73 // expected-warning@+1{{OpenACC construct 'routine' not yet implemented, pragma ignored}}
74 #pragma acc routine(use) bind(NS::RecordTy::Value)
75 // expected-warning@+2{{OpenACC clause 'bind' not yet implemented, clause ignored}}
76 // expected-warning@+1{{OpenACC construct 'routine' not yet implemented, pragma ignored}}
77 #pragma acc routine(use) bind(NS::RecordTy::ValuePub)
78 // expected-warning@+2{{OpenACC clause 'bind' not yet implemented, clause ignored}}
79 // expected-warning@+1{{OpenACC construct 'routine' not yet implemented, pragma ignored}}
80 #pragma acc routine(use) bind(NS::TemplTy<int>)
81 // expected-error@+2{{no member named 'unknown' in namespace 'NS'}}
82 // expected-warning@+1{{OpenACC construct 'routine' not yet implemented, pragma ignored}}
83 #pragma acc routine(use) bind(NS::unknown<int>)
84 // expected-warning@+2{{OpenACC clause 'bind' not yet implemented, clause ignored}}
85 // expected-warning@+1{{OpenACC construct 'routine' not yet implemented, pragma ignored}}
86 #pragma acc routine(use) bind(NS::function)
87 // expected-error@+4{{'priv_mem_function' is a private member of 'NS::RecordTy'}}
88 // expected-note@#PrivMemFun{{implicitly declared private here}}
89 // expected-warning@+2{{OpenACC clause 'bind' not yet implemented, clause ignored}}
90 // expected-warning@+1{{OpenACC construct 'routine' not yet implemented, pragma ignored}}
91 #pragma acc routine(use) bind(NS::RecordTy::priv_mem_function)
92 // expected-warning@+2{{OpenACC clause 'bind' not yet implemented, clause ignored}}
93 // expected-warning@+1{{OpenACC construct 'routine' not yet implemented, pragma ignored}}
94 #pragma acc routine(use) bind(NS::RecordTy::mem_function)
96 // expected-error@+2{{string literal with user-defined suffix cannot be used here}}
97 // expected-warning@+1{{OpenACC construct 'routine' not yet implemented, pragma ignored}}
98 #pragma acc routine(use) bind("unknown udl"_UDL)
100 // expected-warning@+3{{encoding prefix 'u' on an unevaluated string literal has no effect}}
101 // expected-warning@+2{{OpenACC clause 'bind' not yet implemented, clause ignored}}
102 // expected-warning@+1{{OpenACC construct 'routine' not yet implemented, pragma ignored}}
103 #pragma acc routine(use) bind(u"16 bits")
104 // expected-warning@+3{{encoding prefix 'U' on an unevaluated string literal has no effect}}
105 // expected-warning@+2{{OpenACC clause 'bind' not yet implemented, clause ignored}}
106 // expected-warning@+1{{OpenACC construct 'routine' not yet implemented, pragma ignored}}
107 #pragma acc routine(use) bind(U"32 bits")