Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / OpenMP / taskwait_messages.cpp
blob84257dc85d40a8c3ba82741981dddfe8a4fca2f9
1 // RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -ferror-limit 100 %s -Wuninitialized
3 // RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ferror-limit 100 %s -Wuninitialized
5 template <class T>
6 T tmain(T argc) {
7 #pragma omp taskwait allocate(argc) // expected-error {{unexpected OpenMP clause 'allocate' in directive '#pragma omp taskwait'}}
8 #pragma omp taskwait depend(in:argc) // expected-error {{unexpected OpenMP clause 'depend' in directive '#pragma omp taskwait'}}
10 #pragma omp taskwait untied // expected-error {{unexpected OpenMP clause 'untied' in directive '#pragma omp taskwait'}}
11 #pragma omp taskwait unknown // expected-warning {{extra tokens at the end of '#pragma omp taskwait' are ignored}}
12 if (argc)
13 #pragma omp taskwait // expected-error {{'#pragma omp taskwait' cannot be an immediate substatement}}
14 if (argc) {
15 #pragma omp taskwait
17 while (argc)
18 #pragma omp taskwait // expected-error {{'#pragma omp taskwait' cannot be an immediate substatement}}
19 while (argc) {
20 #pragma omp taskwait
23 #pragma omp taskwait // expected-error {{'#pragma omp taskwait' cannot be an immediate substatement}}
24 while (argc)
26 do {
27 #pragma omp taskwait
28 } while (argc);
29 switch (argc)
30 #pragma omp taskwait // expected-error {{'#pragma omp taskwait' cannot be an immediate substatement}}
31 switch (argc)
32 case 1:
33 #pragma omp taskwait // expected-error {{'#pragma omp taskwait' cannot be an immediate substatement}}
34 switch (argc)
35 case 1: {
36 #pragma omp taskwait
38 switch (argc) {
39 #pragma omp taskwait
40 case 1:
41 #pragma omp taskwait
42 break;
43 default: {
44 #pragma omp taskwait
45 } break;
47 for (;;)
48 #pragma omp taskwait // expected-error {{'#pragma omp taskwait' cannot be an immediate substatement}}
49 for (;;) {
50 #pragma omp taskwait
52 label:
53 #pragma omp taskwait
54 label1 : {
55 #pragma omp taskwait
58 return T();
61 int main(int argc, char **argv) {
62 #pragma omp taskwait
64 #pragma omp taskwait untied // expected-error {{unexpected OpenMP clause 'untied' in directive '#pragma omp taskwait'}}
65 #pragma omp taskwait unknown // expected-warning {{extra tokens at the end of '#pragma omp taskwait' are ignored}}
66 if (argc)
67 #pragma omp taskwait // expected-error {{'#pragma omp taskwait' cannot be an immediate substatement}}
68 if (argc) {
69 #pragma omp taskwait
71 while (argc)
72 #pragma omp taskwait // expected-error {{'#pragma omp taskwait' cannot be an immediate substatement}}
73 while (argc) {
74 #pragma omp taskwait
77 #pragma omp taskwait // expected-error {{'#pragma omp taskwait' cannot be an immediate substatement}}
78 while (argc)
80 do {
81 #pragma omp taskwait
82 } while (argc);
83 switch (argc)
84 #pragma omp taskwait // expected-error {{'#pragma omp taskwait' cannot be an immediate substatement}}
85 switch (argc)
86 case 1:
87 #pragma omp taskwait // expected-error {{'#pragma omp taskwait' cannot be an immediate substatement}}
88 switch (argc)
89 case 1: {
90 #pragma omp taskwait
92 switch (argc) {
93 #pragma omp taskwait
94 case 1:
95 #pragma omp taskwait
96 break;
97 default: {
98 #pragma omp taskwait
99 } break;
101 for (;;)
102 #pragma omp taskwait // expected-error {{'#pragma omp taskwait' cannot be an immediate substatement}}
103 for (;;) {
104 #pragma omp taskwait
106 label:
107 #pragma omp taskwait
108 label1 : {
109 #pragma omp taskwait
112 return tmain(argc);