[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / OpenMP / taskyield_messages.cpp
blob0a1c7eeb0cd58546b4d272cae9a42061e634165d
1 // RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
3 // RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
5 template <class T>
6 T tmain(T argc) {
7 #pragma omp taskyield allocate(argc) // expected-error {{unexpected OpenMP clause 'allocate' in directive '#pragma omp taskyield'}}
9 #pragma omp taskyield untied // expected-error {{unexpected OpenMP clause 'untied' in directive '#pragma omp taskyield'}}
10 #pragma omp taskyield unknown // expected-warning {{extra tokens at the end of '#pragma omp taskyield' are ignored}}
11 if (argc)
12 #pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}
13 if (argc) {
14 #pragma omp taskyield
16 while (argc)
17 #pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}
18 while (argc) {
19 #pragma omp taskyield
22 #pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}
23 while (argc)
25 do {
26 #pragma omp taskyield
27 } while (argc);
28 switch (argc)
29 #pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}
30 switch (argc)
31 case 1:
32 #pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}
33 switch (argc)
34 case 1: {
35 #pragma omp taskyield
37 switch (argc) {
38 #pragma omp taskyield
39 case 1:
40 #pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}
41 break;
42 default: {
43 #pragma omp taskyield
44 } break;
46 for (;;)
47 #pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}
48 for (;;) {
49 #pragma omp taskyield
51 label:
52 #pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}
53 label1 : {
54 #pragma omp taskyield
56 if (1)
57 label2:
58 #pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}
60 return T();
63 int main(int argc, char **argv) {
64 #pragma omp taskyield
66 #pragma omp taskyield untied // expected-error {{unexpected OpenMP clause 'untied' in directive '#pragma omp taskyield'}}
67 #pragma omp taskyield unknown // expected-warning {{extra tokens at the end of '#pragma omp taskyield' are ignored}}
68 if (argc)
69 #pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}
70 if (argc) {
71 #pragma omp taskyield
73 while (argc)
74 #pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}
75 while (argc) {
76 #pragma omp taskyield
79 #pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}
80 while (argc)
82 do {
83 #pragma omp taskyield
84 } while (argc);
85 switch (argc)
86 #pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}
87 switch (argc)
88 case 1:
89 #pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}
90 switch (argc)
91 case 1: {
92 #pragma omp taskyield
94 switch (argc) {
95 #pragma omp taskyield
96 case 1:
97 #pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}
98 break;
99 default: {
100 #pragma omp taskyield
101 } break;
103 for (;;)
104 #pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}
105 for (;;) {
106 #pragma omp taskyield
108 label:
109 #pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}
110 label1 : {
111 #pragma omp taskyield
113 if (1)
114 label2:
115 #pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}
117 return tmain(argc);