Revert "[ubsan] Add -fsanitize-merge (and -fno-sanitize-merge) (#120464)"
[llvm-project.git] / clang / test / ParserOpenACC / parse-clauses.cpp
blob770bc3b976c967c5f97d9515f97b6d1917dfebb6
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 T t;
40 #pragma acc exit data delete(t)
44 struct S {
45 static constexpr unsigned value = 5;
48 void use() {
49 templ<7, S>();
52 namespace NS {
53 void NSFunc();
55 class RecordTy { // #RecTy
56 static constexpr bool Value = false; // #VAL
57 void priv_mem_function(); // #PrivMemFun
58 public:
59 static constexpr bool ValuePub = true;
60 void mem_function();
62 template<typename T>
63 class TemplTy{};
64 void function();
68 // expected-warning@+2{{OpenACC clause 'bind' not yet implemented, clause ignored}}
69 // expected-warning@+1{{OpenACC construct 'routine' not yet implemented, pragma ignored}}
70 #pragma acc routine(use) bind(NS::NSFunc)
71 // expected-error@+3{{'RecordTy' does not refer to a value}}
72 // expected-note@#RecTy{{declared here}}
73 // expected-warning@+1{{OpenACC construct 'routine' not yet implemented, pragma ignored}}
74 #pragma acc routine(use) bind(NS::RecordTy)
75 // expected-error@+4{{'Value' is a private member of 'NS::RecordTy'}}
76 // expected-note@#VAL{{implicitly declared private here}}
77 // expected-warning@+2{{OpenACC clause 'bind' not yet implemented, clause ignored}}
78 // expected-warning@+1{{OpenACC construct 'routine' not yet implemented, pragma ignored}}
79 #pragma acc routine(use) bind(NS::RecordTy::Value)
80 // expected-warning@+2{{OpenACC clause 'bind' not yet implemented, clause ignored}}
81 // expected-warning@+1{{OpenACC construct 'routine' not yet implemented, pragma ignored}}
82 #pragma acc routine(use) bind(NS::RecordTy::ValuePub)
83 // expected-warning@+2{{OpenACC clause 'bind' not yet implemented, clause ignored}}
84 // expected-warning@+1{{OpenACC construct 'routine' not yet implemented, pragma ignored}}
85 #pragma acc routine(use) bind(NS::TemplTy<int>)
86 // expected-error@+2{{no member named 'unknown' in namespace 'NS'}}
87 // expected-warning@+1{{OpenACC construct 'routine' not yet implemented, pragma ignored}}
88 #pragma acc routine(use) bind(NS::unknown<int>)
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::function)
92 // expected-error@+4{{'priv_mem_function' is a private member of 'NS::RecordTy'}}
93 // expected-note@#PrivMemFun{{implicitly declared private here}}
94 // expected-warning@+2{{OpenACC clause 'bind' not yet implemented, clause ignored}}
95 // expected-warning@+1{{OpenACC construct 'routine' not yet implemented, pragma ignored}}
96 #pragma acc routine(use) bind(NS::RecordTy::priv_mem_function)
97 // expected-warning@+2{{OpenACC clause 'bind' not yet implemented, clause ignored}}
98 // expected-warning@+1{{OpenACC construct 'routine' not yet implemented, pragma ignored}}
99 #pragma acc routine(use) bind(NS::RecordTy::mem_function)
101 // expected-error@+2{{string literal with user-defined suffix cannot be used here}}
102 // expected-warning@+1{{OpenACC construct 'routine' not yet implemented, pragma ignored}}
103 #pragma acc routine(use) bind("unknown udl"_UDL)
105 // expected-warning@+3{{encoding prefix 'u' on an unevaluated string literal has no effect}}
106 // expected-warning@+2{{OpenACC clause 'bind' not yet implemented, clause ignored}}
107 // expected-warning@+1{{OpenACC construct 'routine' not yet implemented, pragma ignored}}
108 #pragma acc routine(use) bind(u"16 bits")
109 // expected-warning@+3{{encoding prefix 'U' on an unevaluated string literal has no effect}}
110 // expected-warning@+2{{OpenACC clause 'bind' not yet implemented, clause ignored}}
111 // expected-warning@+1{{OpenACC construct 'routine' not yet implemented, pragma ignored}}
112 #pragma acc routine(use) bind(U"32 bits")