llvm-project/clang/test/SemaOpenACC/combined-construct-default-clause.cpp
erichkeane 1b44c3a142 [OpenACC] enable 'async' clause for combined constructs
No additional work required over what we did for other constructs, so
this is just adding the tests and enabling the clauses.
2024-11-14 11:18:06 -08:00

36 lines
1.4 KiB
C++

// RUN: %clang_cc1 %s -fopenacc -verify
template<typename T>
void SingleOnly() {
#pragma acc parallel loop default(none)
for (unsigned I = 0; I < 5; ++I);
int i;
// expected-error@+2{{OpenACC 'default' clause cannot appear more than once on a 'parallel loop' directive}}
// expected-note@+1{{previous clause is here}}
#pragma acc parallel loop default(present) async default(none)
for (unsigned I = 0; I < 5; ++I);
// expected-warning@+3{{OpenACC clause 'copy' not yet implemented, clause ignored}}
// expected-error@+2{{OpenACC 'default' clause cannot appear more than once on a 'serial loop' directive}}
// expected-note@+1{{previous clause is here}}
#pragma acc serial loop async default(present) copy(i) default(none) self
for (unsigned I = 0; I < 5; ++I);
// expected-warning@+3{{OpenACC clause 'copy' not yet implemented, clause ignored}}
// expected-error@+2{{OpenACC 'default' clause cannot appear more than once on a 'kernels loop' directive}}
// expected-note@+1{{previous clause is here}}
#pragma acc kernels loop async default(present) copy(i) default(none) self
for (unsigned I = 0; I < 5; ++I);
// expected-warning@+2{{OpenACC clause 'copy' not yet implemented, clause ignored}}
// expected-error@+1{{expected '('}}
#pragma acc parallel loop async default(none) copy(i) default self
for (unsigned I = 0; I < 5; ++I);
}
void Instantiate() {
SingleOnly<int>();
}