llvm-project
97 строк · 4.1 Кб
1// RUN: %clang_cc1 %s -verify -fopenacc
2
3template<unsigned I, typename T>4void templ() {5// expected-warning@+1{{OpenACC clause 'collapse' not yet implemented, clause ignored}}6#pragma acc loop collapse(I)7for(;;){}8
9// expected-warning@+1{{OpenACC clause 'collapse' not yet implemented, clause ignored}}10#pragma acc loop collapse(T::value)11for(;;){}12
13#pragma acc parallel vector_length(T::value)14for(;;){}15
16#pragma acc parallel vector_length(I)17for(;;){}18
19#pragma acc parallel async(T::value)20for(;;){}21
22#pragma acc parallel async(I)23for(;;){}24
25#pragma acc parallel async26for(;;){}27}
28
29struct S {30static constexpr unsigned value = 5;31};32
33void use() {34templ<7, S>();35}
36
37namespace NS {38void NSFunc();39
40class RecordTy { // #RecTy41static constexpr bool Value = false; // #VAL42void priv_mem_function(); // #PrivMemFun43public:44static constexpr bool ValuePub = true;45void mem_function();46};47template<typename T>48class TemplTy{};49void function();50}
51
52
53// expected-warning@+2{{OpenACC clause 'bind' not yet implemented, clause ignored}}54// expected-warning@+1{{OpenACC construct 'routine' not yet implemented, pragma ignored}}55#pragma acc routine(use) bind(NS::NSFunc)56// expected-error@+3{{'RecordTy' does not refer to a value}}57// expected-note@#RecTy{{declared here}}58// expected-warning@+1{{OpenACC construct 'routine' not yet implemented, pragma ignored}}59#pragma acc routine(use) bind(NS::RecordTy)60// expected-error@+4{{'Value' is a private member of 'NS::RecordTy'}}61// expected-note@#VAL{{implicitly declared private here}}62// expected-warning@+2{{OpenACC clause 'bind' not yet implemented, clause ignored}}63// expected-warning@+1{{OpenACC construct 'routine' not yet implemented, pragma ignored}}64#pragma acc routine(use) bind(NS::RecordTy::Value)65// expected-warning@+2{{OpenACC clause 'bind' not yet implemented, clause ignored}}66// expected-warning@+1{{OpenACC construct 'routine' not yet implemented, pragma ignored}}67#pragma acc routine(use) bind(NS::RecordTy::ValuePub)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::TemplTy<int>)71// expected-error@+2{{no member named 'unknown' in namespace 'NS'}}72// expected-warning@+1{{OpenACC construct 'routine' not yet implemented, pragma ignored}}73#pragma acc routine(use) bind(NS::unknown<int>)74// expected-warning@+2{{OpenACC clause 'bind' not yet implemented, clause ignored}}75// expected-warning@+1{{OpenACC construct 'routine' not yet implemented, pragma ignored}}76#pragma acc routine(use) bind(NS::function)77// expected-error@+4{{'priv_mem_function' is a private member of 'NS::RecordTy'}}78// expected-note@#PrivMemFun{{implicitly declared private here}}79// expected-warning@+2{{OpenACC clause 'bind' not yet implemented, clause ignored}}80// expected-warning@+1{{OpenACC construct 'routine' not yet implemented, pragma ignored}}81#pragma acc routine(use) bind(NS::RecordTy::priv_mem_function)82// expected-warning@+2{{OpenACC clause 'bind' not yet implemented, clause ignored}}83// expected-warning@+1{{OpenACC construct 'routine' not yet implemented, pragma ignored}}84#pragma acc routine(use) bind(NS::RecordTy::mem_function)85
86// expected-error@+2{{string literal with user-defined suffix cannot be used here}}87// expected-warning@+1{{OpenACC construct 'routine' not yet implemented, pragma ignored}}88#pragma acc routine(use) bind("unknown udl"_UDL)89
90// expected-warning@+3{{encoding prefix 'u' on an unevaluated string literal has no effect}}91// expected-warning@+2{{OpenACC clause 'bind' not yet implemented, clause ignored}}92// expected-warning@+1{{OpenACC construct 'routine' not yet implemented, pragma ignored}}93#pragma acc routine(use) bind(u"16 bits")94// expected-warning@+3{{encoding prefix 'U' on an unevaluated string literal has no effect}}95// expected-warning@+2{{OpenACC clause 'bind' not yet implemented, clause ignored}}96// expected-warning@+1{{OpenACC construct 'routine' not yet implemented, pragma ignored}}97#pragma acc routine(use) bind(U"32 bits")98