| 1 |
// Check no warnings/errors |
| 2 |
// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fopenmp -fopenmp-version=60 -fsyntax-only -verify %s |
| 3 |
// expected-no-diagnostics |
| 4 |
|
| 5 |
// Check AST and unparsing |
| 6 |
// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fopenmp -fopenmp-version=60 -ast-dump %s | FileCheck %s --check-prefix=DUMP |
| 7 |
// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fopenmp -fopenmp-version=60 -ast-print %s | FileCheck %s --check-prefix=PRINT |
| 8 |
|
| 9 |
// Check same results after serialization round-trip |
| 10 |
// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fopenmp -fopenmp-version=60 -emit-pch -o %t %s |
| 11 |
// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fopenmp -fopenmp-version=60 -include-pch %t -ast-dump-all %s | FileCheck %s --check-prefix=DUMP |
| 12 |
// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fopenmp -fopenmp-version=60 -include-pch %t -ast-print %s | FileCheck %s --check-prefix=PRINT |
| 13 |
|
| 14 |
#ifndef HEADER |
| 15 |
#define HEADER |
| 16 |
|
| 17 |
void nowait() { |
| 18 |
int A=1; |
| 19 |
|
| 20 |
// DUMP: OMPTargetDirective |
| 21 |
// DUMP-NEXT: OMPNowaitClause |
| 22 |
// PRINT: #pragma omp target nowait |
| 23 |
#pragma omp target nowait |
| 24 |
{ |
| 25 |
} |
| 26 |
|
| 27 |
// DUMP: OMPTargetDirective |
| 28 |
// DUMP-NEXT: OMPNowaitClause |
| 29 |
// DUMP-NEXT: XXBoolLiteralExpr {{.*}} 'bool' false |
| 30 |
// PRINT: #pragma omp target nowait(false) |
| 31 |
#pragma omp target nowait(false) |
| 32 |
{ |
| 33 |
} |
| 34 |
|
| 35 |
// DUMP: OMPTargetDirective |
| 36 |
// DUMP-NEXT: OMPNowaitClause |
| 37 |
// DUMP-NEXT: XXBoolLiteralExpr {{.*}} 'bool' true |
| 38 |
// PRINT: #pragma omp target nowait(true) |
| 39 |
#pragma omp target nowait(true) |
| 40 |
{ |
| 41 |
} |
| 42 |
|
| 43 |
// DUMP: OMPTargetDirective |
| 44 |
// DUMP-NEXT: OMPNowaitClause |
| 45 |
// DUMP-NEXT: BinaryOperator {{.*}} 'bool' '>' |
| 46 |
// DUMP-NEXT: ImplicitCastExpr {{.*}} 'int' <LValueToRValue> |
| 47 |
// DUMP-NEXT: DeclRefExpr {{.*}} 'int' lvalue Var {{.*}} 'A' 'int' |
| 48 |
// DUMP-NEXT: IntegerLiteral {{.*}} 'int' 5 |
| 49 |
// PRINT: #pragma omp target nowait(A > 5) |
| 50 |
#pragma omp target nowait(A>5) |
| 51 |
{ |
| 52 |
} |
| 53 |
|
| 54 |
} |
| 55 |
#endif |