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 -fsyntax-only -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 -fsyntax-only -verify %s -ast-print | FileCheck %s
8 // expected-no-diagnostics
18 #pragma omp for reduction(inscan, +: a)
19 for (int i
= 0; i
< 10; ++i
) {
20 #pragma omp scan inclusive(a)
25 // CHECK-NEXT: #pragma omp for reduction(inscan, +: a)
26 // CHECK-NEXT: for (int i = 0; i < 10; ++i) {
27 // CHECK-NEXT: #pragma omp scan inclusive(a){{$}}
28 // CHECK: static int a;
29 // CHECK-NEXT: #pragma omp for reduction(inscan, +: a)
30 // CHECK-NEXT: for (int i = 0; i < 10; ++i) {
31 // CHECK-NEXT: #pragma omp scan inclusive(a)
32 // CHECK: static char a;
33 // CHECK-NEXT: #pragma omp for reduction(inscan, +: a)
34 // CHECK-NEXT: for (int i = 0; i < 10; ++i) {
35 // CHECK-NEXT: #pragma omp scan inclusive(a)
37 int main(int argc
, char **argv
) {
39 // CHECK: static int a;
41 #pragma omp for simd reduction(inscan, ^: a, argc)
42 for (int i
= 0; i
< 10; ++i
) {
43 #pragma omp scan exclusive(a, argc)
45 // CHECK-NEXT: #pragma omp parallel
46 // CHECK-NEXT: #pragma omp for simd reduction(inscan, ^: a,argc)
47 // CHECK-NEXT: for (int i = 0; i < 10; ++i) {
48 // CHECK-NEXT: #pragma omp scan exclusive(a,argc){{$}}
49 return tmain(argc
) + tmain(argv
[0][0]) + a
;