llvm-project/clang/test/OpenMP/nothing_messages.cpp
Sunil Kuravinakop ca27f3e3b2 [Clang][OpenMP] Support for omp nothing
Patch to support "#pragma omp nothing"

Reviewed By: tianshilei1992

Differential Revision: https://reviews.llvm.org/D123286
2022-05-24 23:59:31 -05:00

28 lines
473 B
C++

// RUN: %clang_cc1 -verify=expected -fopenmp -ferror-limit 100 %s -Wuninitialized
int mixed() {
int x = 0;
int d = 4;
#pragma omp nothing
x=d;
if(!x) {
#pragma omp nothing
x=d;
}
// expected-error@+2 {{#pragma omp nothing' cannot be an immediate substatement}}
if(!x)
#pragma omp nothing
x=d;
// expected-warning@+2 {{extra tokens at the end of '#pragma omp nothing' are ignored}}
if(!x) {
#pragma omp nothing seq_cst
x=d;
}
return 0;
}