56 lines · cpp
1// Check no warnings/errors2// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fopenmp -fopenmp-version=60 -fsyntax-only -verify %s3// expected-no-diagnostics4 5// Check AST and unparsing6// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fopenmp -fopenmp-version=60 -ast-dump %s | FileCheck %s --check-prefix=DUMP7// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fopenmp -fopenmp-version=60 -ast-print %s | FileCheck %s --check-prefix=PRINT8 9// Check same results after serialization round-trip10// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fopenmp -fopenmp-version=60 -emit-pch -o %t %s11// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fopenmp -fopenmp-version=60 -include-pch %t -ast-dump-all %s | FileCheck %s --check-prefix=DUMP12// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fopenmp -fopenmp-version=60 -include-pch %t -ast-print %s | FileCheck %s --check-prefix=PRINT13 14#ifndef HEADER15#define HEADER16 17void nowait() {18 int A=1;19 20 // DUMP: OMPTargetDirective21 // DUMP-NEXT: OMPNowaitClause22 // PRINT: #pragma omp target nowait23 #pragma omp target nowait24 {25 }26 27 // DUMP: OMPTargetDirective28 // DUMP-NEXT: OMPNowaitClause29 // DUMP-NEXT: XXBoolLiteralExpr {{.*}} 'bool' false30 // PRINT: #pragma omp target nowait(false)31 #pragma omp target nowait(false)32 {33 }34 35 // DUMP: OMPTargetDirective36 // DUMP-NEXT: OMPNowaitClause37 // DUMP-NEXT: XXBoolLiteralExpr {{.*}} 'bool' true38 // PRINT: #pragma omp target nowait(true)39 #pragma omp target nowait(true)40 {41 }42 43 // DUMP: OMPTargetDirective44 // DUMP-NEXT: OMPNowaitClause45 // DUMP-NEXT: BinaryOperator {{.*}} 'bool' '>'46 // DUMP-NEXT: ImplicitCastExpr {{.*}} 'int' <LValueToRValue>47 // DUMP-NEXT: DeclRefExpr {{.*}} 'int' lvalue Var {{.*}} 'A' 'int'48 // DUMP-NEXT: IntegerLiteral {{.*}} 'int' 549 // PRINT: #pragma omp target nowait(A > 5)50 #pragma omp target nowait(A>5)51 {52 }53 54}55#endif56