diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2017-09-13 11:12:35 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2017-09-13 11:12:35 +0000 |
commit | ed94bd9223c14d101eb54c45b02481c1fb00c91d (patch) | |
tree | 55b51867adef631e4dc47b4b96d77dccd02d4bf9 /clang | |
parent | 67b042c207ef61d8d54d87811b43dd62a39ff966 (diff) | |
download | bcm5719-llvm-ed94bd9223c14d101eb54c45b02481c1fb00c91d.tar.gz bcm5719-llvm-ed94bd9223c14d101eb54c45b02481c1fb00c91d.zip |
[OPENMP] Allow all classes as mappable types.
According to upcoming OpenMP 5.0 all classes/structs are now considered
as mappable, even polymorphic and with static members.
llvm-svn: 313141
Diffstat (limited to 'clang')
15 files changed, 80 insertions, 130 deletions
diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td index 3b3aa14aa71..fb1ebd90491 100644 --- a/clang/include/clang/Basic/DiagnosticSemaKinds.td +++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td @@ -8837,16 +8837,10 @@ def err_omp_expected_base_var_name : Error< "expected variable name as a base of the array %select{subscript|section}0">; def err_omp_map_shared_storage : Error< "variable already marked as mapped in current construct">; -def err_omp_not_mappable_type : Error< - "type %0 is not mappable to target">; def err_omp_invalid_map_type_for_directive : Error< "%select{map type '%1' is not allowed|map type must be specified}0 for '#pragma omp %2'">; def err_omp_no_clause_for_directive : Error< "expected at least one %0 clause for '#pragma omp %1'">; -def note_omp_polymorphic_in_target : Note< - "mappable type cannot be polymorphic">; -def note_omp_static_member_in_target : Note< - "mappable type cannot contain static members">; def err_omp_threadprivate_in_clause : Error< "threadprivate variables are not allowed in '%0' clause">; def err_omp_wrong_ordered_loop_count : Error< diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp index 6c5433bf85e..cb26b4759b2 100644 --- a/clang/lib/Sema/SemaOpenMP.cpp +++ b/clang/lib/Sema/SemaOpenMP.cpp @@ -10574,56 +10574,12 @@ OMPClause *Sema::ActOnOpenMPDeviceClause(Expr *Device, SourceLocation StartLoc, return new (Context) OMPDeviceClause(ValExpr, StartLoc, LParenLoc, EndLoc); } -static bool IsCXXRecordForMappable(Sema &SemaRef, SourceLocation Loc, - DSAStackTy *Stack, CXXRecordDecl *RD) { - if (!RD || RD->isInvalidDecl()) - return true; - - auto QTy = SemaRef.Context.getRecordType(RD); - if (RD->isDynamicClass()) { - SemaRef.Diag(Loc, diag::err_omp_not_mappable_type) << QTy; - SemaRef.Diag(RD->getLocation(), diag::note_omp_polymorphic_in_target); - return false; - } - auto *DC = RD; - bool IsCorrect = true; - for (auto *I : DC->decls()) { - if (I) { - if (auto *MD = dyn_cast<CXXMethodDecl>(I)) { - if (MD->isStatic()) { - SemaRef.Diag(Loc, diag::err_omp_not_mappable_type) << QTy; - SemaRef.Diag(MD->getLocation(), - diag::note_omp_static_member_in_target); - IsCorrect = false; - } - } else if (auto *VD = dyn_cast<VarDecl>(I)) { - if (VD->isStaticDataMember()) { - SemaRef.Diag(Loc, diag::err_omp_not_mappable_type) << QTy; - SemaRef.Diag(VD->getLocation(), - diag::note_omp_static_member_in_target); - IsCorrect = false; - } - } - } - } - - for (auto &I : RD->bases()) { - if (!IsCXXRecordForMappable(SemaRef, I.getLocStart(), Stack, - I.getType()->getAsCXXRecordDecl())) - IsCorrect = false; - } - return IsCorrect; -} - static bool CheckTypeMappable(SourceLocation SL, SourceRange SR, Sema &SemaRef, DSAStackTy *Stack, QualType QTy) { NamedDecl *ND; if (QTy->isIncompleteType(&ND)) { SemaRef.Diag(SL, diag::err_incomplete_type) << QTy << SR; return false; - } else if (CXXRecordDecl *RD = dyn_cast_or_null<CXXRecordDecl>(ND)) { - if (!RD->isInvalidDecl() && !IsCXXRecordForMappable(SemaRef, SL, Stack, RD)) - return false; } return true; } diff --git a/clang/test/OpenMP/declare_target_messages.cpp b/clang/test/OpenMP/declare_target_messages.cpp index b858d53c1ec..5180dd762bd 100644 --- a/clang/test/OpenMP/declare_target_messages.cpp +++ b/clang/test/OpenMP/declare_target_messages.cpp @@ -28,16 +28,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 +56,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(); diff --git a/clang/test/OpenMP/target_map_messages.cpp b/clang/test/OpenMP/target_map_messages.cpp index b9640b965d5..635d2c3507f 100644 --- a/clang/test/OpenMP/target_map_messages.cpp +++ b/clang/test/OpenMP/target_map_messages.cpp @@ -319,8 +319,8 @@ class S2 { public: S2():a(0) { } S2(S2 &s2):a(s2.a) { } - static float S2s; // expected-note 4 {{mappable type cannot contain static members}} - static const float S2sc; // expected-note 4 {{mappable type cannot contain static members}} + static float S2s; + static const float S2sc; }; const float S2::S2sc = 0; const S2 b; @@ -353,7 +353,7 @@ template <class T> struct S6; template<> -struct S6<int> // expected-note {{mappable type cannot be polymorphic}} +struct S6<int> { virtual void foo(); }; @@ -420,8 +420,8 @@ T tmain(T argc) { #pragma omp target data map(tofrom: argc > 0 ? x : y) // expected-error 2 {{expected expression containing only member accesses and/or array sections based on named variables}} #pragma omp target data map(argc) #pragma omp target data map(S1) // expected-error {{'S1' does not refer to a value}} -#pragma omp target data map(a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}} expected-error 2 {{type 'S2' is not mappable to target}} -#pragma omp target data map(ba) // expected-error 2 {{type 'S2' is not mappable to target}} +#pragma omp target data map(a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}} +#pragma omp target data map(ba) #pragma omp target data map(ca) #pragma omp target data map(da) #pragma omp target data map(S2::S2s) @@ -489,9 +489,9 @@ int main(int argc, char **argv) { #pragma omp target data map(tofrom: argc > 0 ? argv[1] : argv[2]) // expected-error {{xpected expression containing only member accesses and/or array sections based on named variables}} #pragma omp target data map(argc) #pragma omp target data map(S1) // expected-error {{'S1' does not refer to a value}} -#pragma omp target data map(a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}} expected-error 2 {{type 'S2' is not mappable to target}} +#pragma omp target data map(a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}} #pragma omp target data map(argv[1]) -#pragma omp target data map(ba) // expected-error 2 {{type 'S2' is not mappable to target}} +#pragma omp target data map(ba) #pragma omp target data map(ca) #pragma omp target data map(da) #pragma omp target data map(S2::S2s) @@ -525,7 +525,7 @@ int main(int argc, char **argv) { {} #pragma omp target firstprivate(j) map(j) // expected-error {{firstprivate variable cannot be in a map clause in '#pragma omp target' directive}} expected-note {{defined as firstprivate}} {} -#pragma omp target map(m) // expected-error {{type 'S6<int>' is not mappable to target}} +#pragma omp target map(m) {} return tmain<int, 3>(argc)+tmain<from, 4>(argc); // expected-note {{in instantiation of function template specialization 'tmain<int, 3>' requested here}} expected-note {{in instantiation of function template specialization 'tmain<int, 4>' requested here}} } diff --git a/clang/test/OpenMP/target_parallel_for_map_messages.cpp b/clang/test/OpenMP/target_parallel_for_map_messages.cpp index f0019f94f49..f3e1c616b40 100644 --- a/clang/test/OpenMP/target_parallel_for_map_messages.cpp +++ b/clang/test/OpenMP/target_parallel_for_map_messages.cpp @@ -14,8 +14,8 @@ class S2 { public: S2():a(0) { } S2(S2 &s2):a(s2.a) { } - static float S2s; // expected-note 4 {{mappable type cannot contain static members}} - static const float S2sc; // expected-note 4 {{mappable type cannot contain static members}} + static float S2s; + static const float S2sc; }; const float S2::S2sc = 0; const S2 b; @@ -116,9 +116,9 @@ T tmain(T argc) { for (i = 0; i < argc; ++i) foo(); #pragma omp target parallel for map(S1) // expected-error {{'S1' does not refer to a value}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target parallel for map(a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}} expected-error 2 {{type 'S2' is not mappable to target}} +#pragma omp target parallel for map(a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target parallel for map(ba) // expected-error 2 {{type 'S2' is not mappable to target}} +#pragma omp target parallel for map(ba) for (i = 0; i < argc; ++i) foo(); #pragma omp target parallel for map(ca) for (i = 0; i < argc; ++i) foo(); @@ -222,11 +222,11 @@ int main(int argc, char **argv) { for (i = 0; i < argc; ++i) foo(); #pragma omp target parallel for map(S1) // expected-error {{'S1' does not refer to a value}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target parallel for map(a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}} expected-error 2 {{type 'S2' is not mappable to target}} +#pragma omp target parallel for map(a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}} for (i = 0; i < argc; ++i) foo(); #pragma omp target parallel for map(argv[1]) for (i = 0; i < argc; ++i) foo(); -#pragma omp target parallel for map(ba) // expected-error 2 {{type 'S2' is not mappable to target}} +#pragma omp target parallel for map(ba) for (i = 0; i < argc; ++i) foo(); #pragma omp target parallel for map(ca) for (i = 0; i < argc; ++i) foo(); diff --git a/clang/test/OpenMP/target_parallel_for_simd_map_messages.cpp b/clang/test/OpenMP/target_parallel_for_simd_map_messages.cpp index 195b39c595c..7e95e10ae5c 100644 --- a/clang/test/OpenMP/target_parallel_for_simd_map_messages.cpp +++ b/clang/test/OpenMP/target_parallel_for_simd_map_messages.cpp @@ -14,8 +14,8 @@ class S2 { public: S2():a(0) { } S2(S2 &s2):a(s2.a) { } - static float S2s; // expected-note 4 {{mappable type cannot contain static members}} - static const float S2sc; // expected-note 4 {{mappable type cannot contain static members}} + static float S2s; + static const float S2sc; }; const float S2::S2sc = 0; const S2 b; @@ -116,9 +116,9 @@ T tmain(T argc) { for (i = 0; i < argc; ++i) foo(); #pragma omp target parallel for simd map(S1) // expected-error {{'S1' does not refer to a value}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target parallel for simd map(a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}} expected-error 2 {{type 'S2' is not mappable to target}} +#pragma omp target parallel for simd map(a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target parallel for simd map(ba) // expected-error 2 {{type 'S2' is not mappable to target}} +#pragma omp target parallel for simd map(ba) for (i = 0; i < argc; ++i) foo(); #pragma omp target parallel for simd map(ca) for (i = 0; i < argc; ++i) foo(); @@ -222,11 +222,11 @@ int main(int argc, char **argv) { for (i = 0; i < argc; ++i) foo(); #pragma omp target parallel for simd map(S1) // expected-error {{'S1' does not refer to a value}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target parallel for simd map(a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}} expected-error 2 {{type 'S2' is not mappable to target}} +#pragma omp target parallel for simd map(a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}} for (i = 0; i < argc; ++i) foo(); #pragma omp target parallel for simd map(argv[1]) for (i = 0; i < argc; ++i) foo(); -#pragma omp target parallel for simd map(ba) // expected-error 2 {{type 'S2' is not mappable to target}} +#pragma omp target parallel for simd map(ba) for (i = 0; i < argc; ++i) foo(); #pragma omp target parallel for simd map(ca) for (i = 0; i < argc; ++i) foo(); diff --git a/clang/test/OpenMP/target_parallel_map_messages.cpp b/clang/test/OpenMP/target_parallel_map_messages.cpp index ca794cecf4c..d3cc742decd 100644 --- a/clang/test/OpenMP/target_parallel_map_messages.cpp +++ b/clang/test/OpenMP/target_parallel_map_messages.cpp @@ -14,8 +14,8 @@ class S2 { public: S2():a(0) { } S2(S2 &s2):a(s2.a) { } - static float S2s; // expected-note 4 {{mappable type cannot contain static members}} - static const float S2sc; // expected-note 4 {{mappable type cannot contain static members}} + static float S2s; + static const float S2sc; }; const float S2::S2sc = 0; const S2 b; @@ -116,9 +116,9 @@ T tmain(T argc) { foo(); #pragma omp target parallel map(S1) // expected-error {{'S1' does not refer to a value}} foo(); -#pragma omp target parallel map(a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}} expected-error 2 {{type 'S2' is not mappable to target}} +#pragma omp target parallel map(a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}} foo(); -#pragma omp target parallel map(ba) // expected-error 2 {{type 'S2' is not mappable to target}} +#pragma omp target parallel map(ba) foo(); #pragma omp target parallel map(ca) foo(); @@ -221,11 +221,11 @@ int main(int argc, char **argv) { foo(); #pragma omp target parallel map(S1) // expected-error {{'S1' does not refer to a value}} foo(); -#pragma omp target parallel map(a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}} expected-error 2 {{type 'S2' is not mappable to target}} +#pragma omp target parallel map(a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}} foo(); #pragma omp target parallel map(argv[1]) foo(); -#pragma omp target parallel map(ba) // expected-error 2 {{type 'S2' is not mappable to target}} +#pragma omp target parallel map(ba) foo(); #pragma omp target parallel map(ca) foo(); diff --git a/clang/test/OpenMP/target_simd_map_messages.cpp b/clang/test/OpenMP/target_simd_map_messages.cpp index 63bbdde7725..2473bbb49be 100644 --- a/clang/test/OpenMP/target_simd_map_messages.cpp +++ b/clang/test/OpenMP/target_simd_map_messages.cpp @@ -14,8 +14,8 @@ class S2 { public: S2():a(0) { } S2(S2 &s2):a(s2.a) { } - static float S2s; // expected-note 4 {{mappable type cannot contain static members}} - static const float S2sc; // expected-note 4 {{mappable type cannot contain static members}} + static float S2s; + static const float S2sc; }; const float S2::S2sc = 0; const S2 b; @@ -112,9 +112,9 @@ T tmain(T argc) { for (i = 0; i < argc; ++i) foo(); #pragma omp target simd map(S1) // expected-error {{'S1' does not refer to a value}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target simd map(a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}} expected-error 2 {{type 'S2' is not mappable to target}} +#pragma omp target simd map(a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target simd map(ba) // expected-error 2 {{type 'S2' is not mappable to target}} +#pragma omp target simd map(ba) for (i = 0; i < argc; ++i) foo(); #pragma omp target simd map(ca) for (i = 0; i < argc; ++i) foo(); @@ -214,11 +214,11 @@ int main(int argc, char **argv) { for (i = 0; i < argc; ++i) foo(); #pragma omp target simd map(S1) // expected-error {{'S1' does not refer to a value}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target simd map(a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}} expected-error 2 {{type 'S2' is not mappable to target}} +#pragma omp target simd map(a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}} for (i = 0; i < argc; ++i) foo(); #pragma omp target simd map(argv[1]) for (i = 0; i < argc; ++i) foo(); -#pragma omp target simd map(ba) // expected-error 2 {{type 'S2' is not mappable to target}} +#pragma omp target simd map(ba) for (i = 0; i < argc; ++i) foo(); #pragma omp target simd map(ca) for (i = 0; i < argc; ++i) foo(); diff --git a/clang/test/OpenMP/target_teams_distribute_map_messages.cpp b/clang/test/OpenMP/target_teams_distribute_map_messages.cpp index 5d815de85b0..eafdccb66bc 100644 --- a/clang/test/OpenMP/target_teams_distribute_map_messages.cpp +++ b/clang/test/OpenMP/target_teams_distribute_map_messages.cpp @@ -14,8 +14,8 @@ class S2 { public: S2():a(0) { } S2(S2 &s2):a(s2.a) { } - static float S2s; // expected-note 4 {{mappable type cannot contain static members}} - static const float S2sc; // expected-note 4 {{mappable type cannot contain static members}} + static float S2s; + static const float S2sc; }; const float S2::S2sc = 0; const S2 b; @@ -116,9 +116,9 @@ T tmain(T argc) { for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute map(S1) // expected-error {{'S1' does not refer to a value}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target teams distribute map(a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}} expected-error 2 {{type 'S2' is not mappable to target}} +#pragma omp target teams distribute map(a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target teams distribute map(ba) // expected-error 2 {{type 'S2' is not mappable to target}} +#pragma omp target teams distribute map(ba) for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute map(ca) for (i = 0; i < argc; ++i) foo(); @@ -222,11 +222,11 @@ int main(int argc, char **argv) { for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute map(S1) // expected-error {{'S1' does not refer to a value}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target teams distribute map(a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}} expected-error 2 {{type 'S2' is not mappable to target}} +#pragma omp target teams distribute map(a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}} for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute map(argv[1]) for (i = 0; i < argc; ++i) foo(); -#pragma omp target teams distribute map(ba) // expected-error 2 {{type 'S2' is not mappable to target}} +#pragma omp target teams distribute map(ba) for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute map(ca) for (i = 0; i < argc; ++i) foo(); diff --git a/clang/test/OpenMP/target_teams_distribute_parallel_for_map_messages.cpp b/clang/test/OpenMP/target_teams_distribute_parallel_for_map_messages.cpp index 326db95f90f..1fb466ee551 100644 --- a/clang/test/OpenMP/target_teams_distribute_parallel_for_map_messages.cpp +++ b/clang/test/OpenMP/target_teams_distribute_parallel_for_map_messages.cpp @@ -14,8 +14,8 @@ class S2 { public: S2():a(0) { } S2(S2 &s2):a(s2.a) { } - static float S2s; // expected-note 4 {{mappable type cannot contain static members}} - static const float S2sc; // expected-note 4 {{mappable type cannot contain static members}} + static float S2s; + static const float S2sc; }; const float S2::S2sc = 0; const S2 b; @@ -116,9 +116,9 @@ T tmain(T argc) { for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute parallel for map(S1) // expected-error {{'S1' does not refer to a value}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target teams distribute parallel for map(a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}} expected-error 2 {{type 'S2' is not mappable to target}} +#pragma omp target teams distribute parallel for map(a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target teams distribute parallel for map(ba) // expected-error 2 {{type 'S2' is not mappable to target}} +#pragma omp target teams distribute parallel for map(ba) for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute parallel for map(ca) for (i = 0; i < argc; ++i) foo(); @@ -222,11 +222,11 @@ int main(int argc, char **argv) { for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute parallel for map(S1) // expected-error {{'S1' does not refer to a value}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target teams distribute parallel for map(a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}} expected-error 2 {{type 'S2' is not mappable to target}} +#pragma omp target teams distribute parallel for map(a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}} for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute parallel for map(argv[1]) for (i = 0; i < argc; ++i) foo(); -#pragma omp target teams distribute parallel for map(ba) // expected-error 2 {{type 'S2' is not mappable to target}} +#pragma omp target teams distribute parallel for map(ba) for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute parallel for map(ca) for (i = 0; i < argc; ++i) foo(); diff --git a/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_map_messages.cpp b/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_map_messages.cpp index 8f9c3e7e073..b230d9ab24f 100644 --- a/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_map_messages.cpp +++ b/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_map_messages.cpp @@ -14,8 +14,8 @@ class S2 { public: S2():a(0) { } S2(S2 &s2):a(s2.a) { } - static float S2s; // expected-note 4 {{mappable type cannot contain static members}} - static const float S2sc; // expected-note 4 {{mappable type cannot contain static members}} + static float S2s; + static const float S2sc; }; const float S2::S2sc = 0; const S2 b; @@ -116,9 +116,9 @@ T tmain(T argc) { for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute parallel for simd map(S1) // expected-error {{'S1' does not refer to a value}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target teams distribute parallel for simd map(a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}} expected-error 2 {{type 'S2' is not mappable to target}} +#pragma omp target teams distribute parallel for simd map(a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target teams distribute parallel for simd map(ba) // expected-error 2 {{type 'S2' is not mappable to target}} +#pragma omp target teams distribute parallel for simd map(ba) for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute parallel for simd map(ca) for (i = 0; i < argc; ++i) foo(); @@ -222,11 +222,11 @@ int main(int argc, char **argv) { for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute parallel for simd map(S1) // expected-error {{'S1' does not refer to a value}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target teams distribute parallel for simd map(a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}} expected-error 2 {{type 'S2' is not mappable to target}} +#pragma omp target teams distribute parallel for simd map(a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}} for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute parallel for simd map(argv[1]) for (i = 0; i < argc; ++i) foo(); -#pragma omp target teams distribute parallel for simd map(ba) // expected-error 2 {{type 'S2' is not mappable to target}} +#pragma omp target teams distribute parallel for simd map(ba) for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute parallel for simd map(ca) for (i = 0; i < argc; ++i) foo(); diff --git a/clang/test/OpenMP/target_teams_distribute_simd_map_messages.cpp b/clang/test/OpenMP/target_teams_distribute_simd_map_messages.cpp index 414f6f83deb..29d48d958a3 100644 --- a/clang/test/OpenMP/target_teams_distribute_simd_map_messages.cpp +++ b/clang/test/OpenMP/target_teams_distribute_simd_map_messages.cpp @@ -14,8 +14,8 @@ class S2 { public: S2():a(0) { } S2(S2 &s2):a(s2.a) { } - static float S2s; // expected-note 4 {{mappable type cannot contain static members}} - static const float S2sc; // expected-note 4 {{mappable type cannot contain static members}} + static float S2s; + static const float S2sc; }; const float S2::S2sc = 0; const S2 b; @@ -116,9 +116,9 @@ T tmain(T argc) { for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute simd map(S1) // expected-error {{'S1' does not refer to a value}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target teams distribute simd map(a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}} expected-error 2 {{type 'S2' is not mappable to target}} +#pragma omp target teams distribute simd map(a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target teams distribute simd map(ba) // expected-error 2 {{type 'S2' is not mappable to target}} +#pragma omp target teams distribute simd map(ba) for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute simd map(ca) for (i = 0; i < argc; ++i) foo(); @@ -222,11 +222,11 @@ int main(int argc, char **argv) { for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute simd map(S1) // expected-error {{'S1' does not refer to a value}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target teams distribute simd map(a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}} expected-error 2 {{type 'S2' is not mappable to target}} +#pragma omp target teams distribute simd map(a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}} for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute simd map(argv[1]) for (i = 0; i < argc; ++i) foo(); -#pragma omp target teams distribute simd map(ba) // expected-error 2 {{type 'S2' is not mappable to target}} +#pragma omp target teams distribute simd map(ba) for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute simd map(ca) for (i = 0; i < argc; ++i) foo(); diff --git a/clang/test/OpenMP/target_teams_map_messages.cpp b/clang/test/OpenMP/target_teams_map_messages.cpp index 89425d622c1..ae5f7bcdbc2 100644 --- a/clang/test/OpenMP/target_teams_map_messages.cpp +++ b/clang/test/OpenMP/target_teams_map_messages.cpp @@ -312,8 +312,8 @@ class S2 { public: S2():a(0) { } S2(S2 &s2):a(s2.a) { } - static float S2s; // expected-note 4 {{mappable type cannot contain static members}} - static const float S2sc; // expected-note 4 {{mappable type cannot contain static members}} + static float S2s; + static const float S2sc; }; const float S2::S2sc = 0; const S2 b; @@ -346,7 +346,7 @@ template <class T> struct S6; template<> -struct S6<int> // expected-note {{mappable type cannot be polymorphic}} +struct S6<int> { virtual void foo(); }; @@ -414,8 +414,8 @@ T tmain(T argc) { #pragma omp target data map(tofrom: argc > 0 ? x : y) // expected-error 2 {{expected expression containing only member accesses and/or array sections based on named variables}} #pragma omp target data map(argc) #pragma omp target data map(S1) // expected-error {{'S1' does not refer to a value}} -#pragma omp target data map(a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}} expected-error 2 {{type 'S2' is not mappable to target}} -#pragma omp target data map(ba) // expected-error 2 {{type 'S2' is not mappable to target}} +#pragma omp target data map(a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}} +#pragma omp target data map(ba) #pragma omp target data map(ca) #pragma omp target data map(da) #pragma omp target data map(S2::S2s) @@ -488,9 +488,9 @@ int main(int argc, char **argv) { #pragma omp target data map(tofrom: argc > 0 ? argv[1] : argv[2]) // expected-error {{xpected expression containing only member accesses and/or array sections based on named variables}} #pragma omp target data map(argc) #pragma omp target data map(S1) // expected-error {{'S1' does not refer to a value}} -#pragma omp target data map(a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}} expected-error 2 {{type 'S2' is not mappable to target}} +#pragma omp target data map(a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}} #pragma omp target data map(argv[1]) -#pragma omp target data map(ba) // expected-error 2 {{type 'S2' is not mappable to target}} +#pragma omp target data map(ba) #pragma omp target data map(ca) #pragma omp target data map(da) #pragma omp target data map(S2::S2s) @@ -530,7 +530,7 @@ int main(int argc, char **argv) { #pragma omp target teams firstprivate(j) map(j) // expected-error {{firstprivate variable cannot be in a map clause in '#pragma omp target teams' directive}} expected-note {{defined as firstprivate}} {} -#pragma omp target teams map(m) // expected-error {{type 'S6<int>' is not mappable to target}} +#pragma omp target teams map(m) {} return tmain<int, 3>(argc)+tmain<from, 4>(argc); // expected-note {{in instantiation of function template specialization 'tmain<int, 3>' requested here}} expected-note {{in instantiation of function template specialization 'tmain<int, 4>' requested here}} diff --git a/clang/test/OpenMP/target_update_from_messages.cpp b/clang/test/OpenMP/target_update_from_messages.cpp index 6aff083b6a4..c42bd12f75b 100644 --- a/clang/test/OpenMP/target_update_from_messages.cpp +++ b/clang/test/OpenMP/target_update_from_messages.cpp @@ -14,8 +14,8 @@ class S2 { public: S2():a(0) { } S2(S2 &s2):a(s2.a) { } - static float S2s; // expected-note 4 {{mappable type cannot contain static members}} - static const float S2sc; // expected-note 4 {{mappable type cannot contain static members}} + static float S2s; + static const float S2sc; }; const float S2::S2sc = 0; const S2 b; @@ -94,8 +94,8 @@ T tmain(T argc) { #pragma omp target update from(y x) // expected-error {{expected ',' or ')' in 'from' clause}} #pragma omp target update from(argc > 0 ? x : y) // expected-error 2 {{expected expression containing only member accesses and/or array sections based on named variables}} #pragma omp target update from(S1) // expected-error {{'S1' does not refer to a value}}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}} -#pragma omp target update from(a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}} expected-error 2 {{type 'S2' is not mappable to target}} -#pragma omp target update from(ba) // expected-error 2 {{type 'S2' is not mappable to target}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}} +#pragma omp target update from(a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}} +#pragma omp target update from(ba) #pragma omp target update from(h) // expected-error {{threadprivate variables are not allowed in 'from' clause}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}} #pragma omp target update from(k), to(k) // expected-error 2 {{variable can appear only once in OpenMP 'target update' construct}} expected-note 2 {{used here}} #pragma omp target update from(t), from(t[:5]) // expected-error 2 {{variable can appear only once in OpenMP 'target update' construct}} expected-note 2 {{used here}} @@ -148,8 +148,8 @@ int main(int argc, char **argv) { #pragma omp target update from(y x) // expected-error {{expected ',' or ')' in 'from' clause}} #pragma omp target update from(argc > 0 ? x : y) // expected-error {{expected expression containing only member accesses and/or array sections based on named variables}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}} #pragma omp target update from(S1) // expected-error {{'S1' does not refer to a value}}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}} -#pragma omp target update from(a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}} expected-error 2 {{type 'S2' is not mappable to target}} -#pragma omp target update from(ba) // expected-error 2 {{type 'S2' is not mappable to target}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}} +#pragma omp target update from(a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}} +#pragma omp target update from(ba) #pragma omp target update from(h) // expected-error {{threadprivate variables are not allowed in 'from' clause}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}} #pragma omp target update from(k), to(k) // expected-error {{variable can appear only once in OpenMP 'target update' construct}} expected-note {{used here}} #pragma omp target update from(t), from(t[:5]) // expected-error {{variable can appear only once in OpenMP 'target update' construct}} expected-note {{used here}} diff --git a/clang/test/OpenMP/target_update_to_messages.cpp b/clang/test/OpenMP/target_update_to_messages.cpp index 641d0bd949a..9bde51e9839 100644 --- a/clang/test/OpenMP/target_update_to_messages.cpp +++ b/clang/test/OpenMP/target_update_to_messages.cpp @@ -14,8 +14,8 @@ class S2 { public: S2():a(0) { } S2(S2 &s2):a(s2.a) { } - static float S2s; // expected-note 4 {{mappable type cannot contain static members}} - static const float S2sc; // expected-note 4 {{mappable type cannot contain static members}} + static float S2s; + static const float S2sc; }; const float S2::S2sc = 0; const S2 b; @@ -94,8 +94,8 @@ T tmain(T argc) { #pragma omp target update to(y x) // expected-error {{expected ',' or ')' in 'to' clause}} #pragma omp target update to(argc > 0 ? x : y) // expected-error 2 {{expected expression containing only member accesses and/or array sections based on named variables}} #pragma omp target update to(S1) // expected-error {{'S1' does not refer to a value}}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}} -#pragma omp target update to(a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}} expected-error 2 {{type 'S2' is not mappable to target}} -#pragma omp target update to(ba) // expected-error 2 {{type 'S2' is not mappable to target}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}} +#pragma omp target update to(a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}} +#pragma omp target update to(ba) #pragma omp target update to(h) // expected-error {{threadprivate variables are not allowed in 'to' clause}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}} #pragma omp target update to(k), from(k) // expected-error 2 {{variable can appear only once in OpenMP 'target update' construct}} expected-note 2 {{used here}} #pragma omp target update to(t), to(t[:5]) // expected-error 2 {{variable can appear only once in OpenMP 'target update' construct}} expected-note 2 {{used here}} @@ -147,8 +147,8 @@ int main(int argc, char **argv) { #pragma omp target update to(y x) // expected-error {{expected ',' or ')' in 'to' clause}} #pragma omp target update to(argc > 0 ? x : y) // expected-error {{expected expression containing only member accesses and/or array sections based on named variables}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}} #pragma omp target update to(S1) // expected-error {{'S1' does not refer to a value}}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}} -#pragma omp target update to(a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}} expected-error 2 {{type 'S2' is not mappable to target}} -#pragma omp target update to(ba) // expected-error 2 {{type 'S2' is not mappable to target}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}} +#pragma omp target update to(a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}} +#pragma omp target update to(ba) #pragma omp target update to(h) // expected-error {{threadprivate variables are not allowed in 'to' clause}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}} #pragma omp target update to(k), from(k) // expected-error {{variable can appear only once in OpenMP 'target update' construct}} expected-note {{used here}} #pragma omp target update to(t), to(t[:5]) // expected-error {{variable can appear only once in OpenMP 'target update' construct}} expected-note {{used here}} |