| 1 |
// expected-no-diagnostics |
| 2 |
|
| 3 |
//RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fopenmp -fopenmp-version=60 \ |
| 4 |
//RUN: -x c++ -std=c++14 -fexceptions -fcxx-exceptions \ |
| 5 |
//RUN: -Wno-source-uses-openmp -Wno-openmp-clauses \ |
| 6 |
//RUN: -ast-print %s | FileCheck %s --check-prefix=PRINT |
| 7 |
|
| 8 |
//RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fopenmp -fopenmp-version=60 \ |
| 9 |
//RUN: -x c++ -std=c++14 -fexceptions -fcxx-exceptions \ |
| 10 |
//RUN: -Wno-source-uses-openmp -Wno-openmp-clauses \ |
| 11 |
//RUN: -ast-dump %s | FileCheck %s --check-prefix=DUMP |
| 12 |
|
| 13 |
//RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fopenmp -fopenmp-version=60 \ |
| 14 |
//RUN: -x c++ -std=c++14 -fexceptions -fcxx-exceptions \ |
| 15 |
//RUN: -Wno-source-uses-openmp -Wno-openmp-clauses \ |
| 16 |
//RUN: -emit-pch -o %t %s |
| 17 |
|
| 18 |
//RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fopenmp -fopenmp-version=60 \ |
| 19 |
//RUN: -x c++ -std=c++14 -fexceptions -fcxx-exceptions \ |
| 20 |
//RUN: -Wno-source-uses-openmp -Wno-openmp-clauses \ |
| 21 |
//RUN: -include-pch %t -ast-print %s | FileCheck %s --check-prefix=PRINT |
| 22 |
|
| 23 |
//RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fopenmp -fopenmp-version=60 \ |
| 24 |
//RUN: -x c++ -std=c++14 -fexceptions -fcxx-exceptions \ |
| 25 |
//RUN: -Wno-source-uses-openmp -Wno-openmp-clauses \ |
| 26 |
//RUN: -include-pch %t -ast-dump-all %s | FileCheck %s --check-prefix=DUMP |
| 27 |
|
| 28 |
#ifndef HEADER |
| 29 |
#define HEADER |
| 30 |
|
| 31 |
void foo() { |
| 32 |
int a; |
| 33 |
#pragma omp target default(firstprivate) |
| 34 |
a++; |
| 35 |
// PRINT: #pragma omp target default(firstprivate) |
| 36 |
// PRINT-NEXT: a++; |
| 37 |
// DUMP: -OMPTargetDirective |
| 38 |
// DUMP-NEXT: -OMPDefaultClause |
| 39 |
// DUMP-NEXT: -OMPFirstprivateClause {{.*}} <implicit> |
| 40 |
// DUMP-NEXT: -DeclRefExpr {{.*}} 'a' |
| 41 |
|
| 42 |
} |
| 43 |
void fun(){ |
| 44 |
int a = 0; |
| 45 |
int x = 10; |
| 46 |
#pragma omp target data default(firstprivate) map(a) |
| 47 |
{ |
| 48 |
// DUMP: -OMPTargetDataDirective |
| 49 |
// DUMP-NEXT: -OMPDefaultClause |
| 50 |
// DUMP-NEXT: -OMPMapClause |
| 51 |
// DUMP-NEXT: -DeclRefExpr {{.*}} 'a' |
| 52 |
// DUMP-NEXT: -OMPFirstprivateClause {{.*}} <implicit> |
| 53 |
// DUMP-NEXT: -DeclRefExpr {{.*}} 'x' |
| 54 |
|
| 55 |
|
| 56 |
x += 10; |
| 57 |
a += 1; |
| 58 |
} |
| 59 |
} |
| 60 |
void bar(){ |
| 61 |
int i = 0; |
| 62 |
int j = 0; |
| 63 |
int nn = 10; |
| 64 |
#pragma omp target default(firstprivate) |
| 65 |
#pragma omp teams |
| 66 |
#pragma teams distribute parallel for simd |
| 67 |
for (j = 0; j < nn; j++ ) { |
| 68 |
for (i = 0; i < nn; i++ ) { |
| 69 |
; |
| 70 |
} |
| 71 |
} |
| 72 |
|
| 73 |
// PRINT: #pragma omp target default(firstprivate) |
| 74 |
// DUMP: -OMPTargetDirective |
| 75 |
// DUMP-NEXT: -OMPDefaultClause |
| 76 |
// DUMP-NEXT: -OMPFirstprivateClause {{.*}} <implicit> |
| 77 |
// DUMP-NEXT: -DeclRefExpr {{.*}} 'j' |
| 78 |
// DUMP-NEXT: -DeclRefExpr {{.*}} 'nn' |
| 79 |
// DUMP-NEXT: -DeclRefExpr {{.*}} 'i' |
| 80 |
} |
| 81 |
#endif |