|
1 |
| -// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 200 %s -Wno-openmp-mapping -Wuninitialized |
| 1 | +// RUN: %clang_cc1 -verify=expected,warn -fopenmp -ferror-limit 200 %s -Wuninitialized |
2 | 2 | // RUN: %clang_cc1 -DCCODE -verify -fopenmp -ferror-limit 200 -x c %s -Wno-openmp -Wuninitialized
|
3 | 3 |
|
4 | 4 | // RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 200 %s -Wno-openmp-target -Wuninitialized
|
@@ -499,13 +499,13 @@ T tmain(T argc) {
|
499 | 499 | #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}}
|
500 | 500 | #pragma omp target data map(argc)
|
501 | 501 | #pragma omp target data map(S1) // expected-error {{'S1' does not refer to a value}}
|
502 |
| -#pragma omp target data map(a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}} |
503 |
| -#pragma omp target data map(ba) |
504 |
| -#pragma omp target data map(ca) |
| 502 | +#pragma omp target data map(a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}} warn-warning 2 {{Type 'const S2' is not trivially copyable and not guaranteed to be mapped correctly}} warn-warning 2 {{Type 'const S3' is not trivially copyable and not guaranteed to be mapped correctly}} |
| 503 | +#pragma omp target data map(ba) // warn-warning 2 {{Type 'const S2 [5]' is not trivially copyable and not guaranteed to be mapped correctly}} |
| 504 | +#pragma omp target data map(ca) // warn-warning 2 {{Type 'const S3 [5]' is not trivially copyable and not guaranteed to be mapped correctly}} |
505 | 505 | #pragma omp target data map(da)
|
506 | 506 | #pragma omp target data map(S2::S2s)
|
507 | 507 | #pragma omp target data map(S2::S2sc)
|
508 |
| -#pragma omp target data map(e, g) |
| 508 | +#pragma omp target data map(e, g) // warn-warning 2 {{Type 'S4' is not trivially copyable and not guaranteed to be mapped correctly}} warn-warning 2 {{Type 'S5' is not trivially copyable and not guaranteed to be mapped correctly}} |
509 | 509 | #pragma omp target data map(h) // expected-error {{threadprivate variables are not allowed in 'map' clause}}
|
510 | 510 | #pragma omp target data map(k) map(k) // expected-error 2 {{variable already marked as mapped in current construct}} expected-note 2 {{used here}}
|
511 | 511 | #pragma omp target map(k), map(k[:5]) // expected-error 2 {{pointer cannot be mapped along with a section derived from itself}} expected-note 2 {{used here}}
|
@@ -558,6 +558,17 @@ struct SC1{
|
558 | 558 | int b[10];
|
559 | 559 | };
|
560 | 560 |
|
| 561 | +class S8 { |
| 562 | +public: |
| 563 | + virtual void foo() = 0; |
| 564 | +} *s8; |
| 565 | + |
| 566 | +class S9 { |
| 567 | +public: |
| 568 | + virtual void foo() {} |
| 569 | +} s9; |
| 570 | + |
| 571 | + |
561 | 572 | int main(int argc, char **argv) {
|
562 | 573 | const int d = 5;
|
563 | 574 | const int da[5] = { 0 };
|
@@ -595,14 +606,14 @@ int main(int argc, char **argv) {
|
595 | 606 | #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}}
|
596 | 607 | #pragma omp target data map(argc)
|
597 | 608 | #pragma omp target data map(S1) // expected-error {{'S1' does not refer to a value}}
|
598 |
| -#pragma omp target data map(a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}} |
| 609 | +#pragma omp target data map(a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}} warn-warning {{Type 'const S2' is not trivially copyable and not guaranteed to be mapped correctly}} warn-warning {{Type 'const S3' is not trivially copyable and not guaranteed to be mapped correctly}} |
599 | 610 | #pragma omp target data map(argv[1])
|
600 |
| -#pragma omp target data map(ba) |
601 |
| -#pragma omp target data map(ca) |
| 611 | +#pragma omp target data map(ba) // warn-warning {{Type 'const S2 [5]' is not trivially copyable and not guaranteed to be mapped correctly}} |
| 612 | +#pragma omp target data map(ca) // warn-warning {{Type 'const S3 [5]' is not trivially copyable and not guaranteed to be mapped correctly}} |
602 | 613 | #pragma omp target data map(da)
|
603 | 614 | #pragma omp target data map(S2::S2s)
|
604 | 615 | #pragma omp target data map(S2::S2sc)
|
605 |
| -#pragma omp target data map(e, g) |
| 616 | +#pragma omp target data map(e, g) // warn-warning {{Type 'S4' is not trivially copyable and not guaranteed to be mapped correctly}} warn-warning {{Type 'S5' is not trivially copyable and not guaranteed to be mapped correctly}} |
606 | 617 | #pragma omp target data map(h) // expected-error {{threadprivate variables are not allowed in 'map' clause}}
|
607 | 618 | #pragma omp target data map(k), map(k) // expected-error {{variable already marked as mapped in current construct}} expected-note {{used here}}
|
608 | 619 | #pragma omp target map(k), map(k[:5]) // expected-error {{pointer cannot be mapped along with a section derived from itself}} expected-note {{used here}}
|
@@ -635,7 +646,7 @@ int main(int argc, char **argv) {
|
635 | 646 | {}
|
636 | 647 | #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}}
|
637 | 648 | {}
|
638 |
| -#pragma omp target map(m) |
| 649 | +#pragma omp target map(m) // warn-warning {{Type 'S6<int>' is not trivially copyable and not guaranteed to be mapped correctly}} |
639 | 650 | {}
|
640 | 651 | // expected-note@+1 {{used here}}
|
641 | 652 | #pragma omp target map(s.s.s)
|
@@ -681,6 +692,8 @@ int main(int argc, char **argv) {
|
681 | 692 | { s.a++; }
|
682 | 693 | #pragma omp target map(s.s.s.b[:2])
|
683 | 694 | { s.s.s.b[0]++; }
|
| 695 | +#pragma omp target map(s8[0:1], s9) // warn-warning {{Type 'class S8' is not trivially copyable and not guaranteed to be mapped correctly}} warn-warning {{Type 'class S9' is not trivially copyable and not guaranteed to be mapped correctly}} |
| 696 | + {} |
684 | 697 |
|
685 | 698 | 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}}
|
686 | 699 | }
|
|
0 commit comments