Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / OpenMP / taskgroup_messages.cpp
blobfb774e03b5305eda0f3c7e7fa11c6e29a7e283be
1 // RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
3 // RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
5 void xxx(int argc) {
6 int x; // expected-note {{initialize the variable 'x' to silence this warning}}
7 #pragma omp taskgroup
8 argc = x; // expected-warning {{variable 'x' is uninitialized when used here}}
11 int foo();
13 int main() {
14 #pragma omp taskgroup
16 #pragma omp taskgroup unknown // expected-warning {{extra tokens at the end of '#pragma omp taskgroup' are ignored}}
17 foo();
19 #pragma omp taskgroup
20 } // expected-error {{expected statement}}
21 #pragma omp taskgroup
22 #pragma omp taskgroup
23 for (int i = 0; i < 10; ++i) {
24 foo();
25 #pragma omp parallel
26 #pragma omp for
27 for (int j = 0; j < 10; j++) {
28 foo();
29 #pragma omp taskgroup
30 foo();
33 #pragma omp taskgroup
34 #pragma omp taskgroup
35 for (int i = 0; i < 10; ++i) {
36 foo();
37 #pragma omp parallel
38 #pragma omp for
39 for (int j = 0; j < 10; j++) {
40 #pragma omp taskgroup
41 foo();
44 #pragma omp taskgroup
45 #pragma omp taskgroup
46 for (int i = 0; i < 10; ++i) {
47 foo();
48 #pragma omp parallel
49 #pragma omp for
50 for (int j = 0; j < 10; j++) {
51 #pragma omp taskgroup
52 foo();
56 return 0;
59 int foo() {
60 L1:
61 foo();
62 #pragma omp taskgroup
64 foo();
65 goto L1; // expected-error {{use of undeclared label 'L1'}}
67 goto L2; // expected-error {{use of undeclared label 'L2'}}
68 #pragma omp taskgroup
70 L2:
71 foo();
74 #pragma omp taskgroup initi // expected-warning {{extra tokens at the end of '#pragma omp taskgroup' are ignored}}
76 return 0;