[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / OpenMP / cancellation_point_ast_print.cpp
blob23b1765048f199351b95467a580b646c7844eafd
1 // RUN: %clang_cc1 -verify -fopenmp -ast-print %s | FileCheck %s
2 // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -emit-pch -o %t %s
3 // RUN: %clang_cc1 -fopenmp -std=c++11 -include-pch %t -verify %s -ast-print | FileCheck %s
5 // RUN: %clang_cc1 -verify -fopenmp-simd -ast-print %s | FileCheck %s
6 // RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -emit-pch -o %t %s
7 // RUN: %clang_cc1 -fopenmp-simd -std=c++11 -include-pch %t -verify %s -ast-print | FileCheck %s
8 // expected-no-diagnostics
10 #ifndef HEADER
11 #define HEADER
13 int main (int argc, char **argv) {
14 // CHECK: int main(int argc, char **argv) {
15 #pragma omp parallel
17 #pragma omp cancellation point parallel
19 // CHECK: #pragma omp parallel
20 // CHECK-NEXT: {
21 // CHECK-NEXT: #pragma omp cancellation point parallel{{$}}
22 // CHECK-NEXT: }
23 #pragma omp sections
25 #pragma omp cancellation point sections
27 // CHECK-NEXT: #pragma omp sections
28 // CHECK: {
29 // CHECK: #pragma omp cancellation point sections
30 // CHECK: }
31 #pragma omp for
32 for (int i = 0; i < argc; ++i) {
33 #pragma omp cancellation point for
35 // CHECK: #pragma omp for
36 // CHECK-NEXT: for (int i = 0; i < argc; ++i) {
37 // CHECK-NEXT: #pragma omp cancellation point for
38 // CHECK-NEXT: }
39 #pragma omp task
41 #pragma omp cancellation point taskgroup
43 // CHECK: #pragma omp task
44 // CHECK: {
45 // CHECK: #pragma omp cancellation point taskgroup
46 // CHECK: }
47 // CHECK: return argc;
48 return argc;
51 #endif