llvm-project/clang/test/OpenMP/nothing_ast_print.cpp
Sandeep Kosuri ecc080c07d
[OpenMP] return empty stmt for nothing (#74042)
- `nothing` directive was effecting the `if` block structure which it
should not. So return an empty statement instead of an error statement
while parsing to avoid this.
2023-12-03 13:33:38 +05:30

20 lines
421 B
C++

// RUN: %clang_cc1 -fopenmp -ast-print %s | FileCheck %s --check-prefix=PRINT
// RUN: %clang_cc1 -ast-print %s | FileCheck %s --check-prefix=PRINT
// Checks whether the `if` body looks same with and without OpenMP enabled
void foo() {
return;
}
int main() {
int x = 3;
if (x % 2 == 0)
#pragma omp nothing
foo();
return 0;
// PRINT: if (x % 2 == 0)
// PRINT: foo();
// PRINT: return 0;
}