diff options
Diffstat (limited to 'test/OpenMP/declare_target_messages.cpp')
-rw-r--r-- | test/OpenMP/declare_target_messages.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/test/OpenMP/declare_target_messages.cpp b/test/OpenMP/declare_target_messages.cpp index b858d53c1ecf..c1c03951a3c1 100644 --- a/test/OpenMP/declare_target_messages.cpp +++ b/test/OpenMP/declare_target_messages.cpp @@ -13,8 +13,16 @@ void f(); #pragma omp declare target map(a) // expected-error {{unexpected 'map' clause, only 'to' or 'link' clauses expected}} +#pragma omp declare target to(foo1) // expected-error {{use of undeclared identifier 'foo1'}} + +#pragma omp declare target link(foo2) // expected-error {{use of undeclared identifier 'foo2'}} + void c(); // expected-warning {{declaration is not declared in any declare target region}} +void func() {} // expected-note {{'func' defined here}} + +#pragma omp declare target link(func) // expected-error {{function name is not allowed in 'link' clause}} + extern int b; struct NonT { @@ -28,16 +36,16 @@ typedef int sint; extern int b; int g; -struct T { // expected-note {{mappable type cannot be polymorphic}} +struct T { int a; virtual int method(); }; -class VC { // expected-note {{mappable type cannot be polymorphic}} +class VC { T member; NonT member1; public: - virtual int method() { T a; return 0; } // expected-error {{type 'T' is not mappable to target}} + virtual int method() { T a; return 0; } }; struct C { @@ -56,7 +64,7 @@ void foo() { b = 0; // expected-note {{used here}} t = 1; // expected-error {{threadprivate variables cannot be used in target constructs}} C object; - VC object1; // expected-error {{type 'VC' is not mappable to target}} + VC object1; g = object.method(); g += object.method1(); g += object1.method(); @@ -73,9 +81,9 @@ int C::method() { } struct S { -#pragma omp declare target // expected-error {{directive must be at file or namespace scope}} +#pragma omp declare target int v; -#pragma omp end declare target // expected-error {{unexpected OpenMP directive '#pragma omp end declare target'}} +#pragma omp end declare target }; int main (int argc, char **argv) { |