Files
clang-p2996/clang/test/SemaOpenACC/compute-construct-default-clause.c
erichkeane 1f2aeef97b [OpenACC] Enable copy/create clauses for combined constructs
This is the last set of 'no op' changes, and are all incredibly similar,
so they are being done together.  They work the exact same for combined
constructs as they do for compute constructs, so this adds tests and
enables them.
2024-12-02 11:15:35 -08:00

49 lines
1.7 KiB
C

// RUN: %clang_cc1 %s -fopenacc -verify
void SingleOnly() {
#pragma acc parallel default(none)
while(0);
// expected-error@+2{{OpenACC 'default' clause cannot appear more than once on a 'serial' directive}}
// expected-note@+1{{previous clause is here}}
#pragma acc serial default(present) self default(none)
while(0);
int i;
// expected-error@+2{{OpenACC 'default' clause cannot appear more than once on a 'kernels' directive}}
// expected-note@+1{{previous clause is here}}
#pragma acc kernels self default(present) present(i) default(none) copy(i)
while(0);
// expected-error@+2{{OpenACC 'default' clause cannot appear more than once on a 'parallel' directive}}
// expected-note@+1{{previous clause is here}}
#pragma acc parallel self default(present) private(i) default(none) copy(i)
for(int i = 0; i < 5; ++i);
// expected-error@+1{{expected '('}}
#pragma acc serial self default private(i) default(none) if(i)
for(int i = 0; i < 5; ++i);
#pragma acc kernels default(none)
for(int i = 0; i < 5; ++i);
// expected-warning@+2{{OpenACC construct 'data' not yet implemented}}
// expected-warning@+1{{OpenACC clause 'default' not yet implemented}}
#pragma acc data default(none)
while(0);
// expected-error@+1{{OpenACC 'default' clause is not valid on 'loop' directive}}
#pragma acc loop default(none)
for(int i = 5; i < 10;++i);
// expected-warning@+2{{OpenACC construct 'wait' not yet implemented}}
// expected-error@+1{{OpenACC 'default' clause is not valid on 'wait' directive}}
#pragma acc wait default(none)
while(0);
// expected-error@+1{{OpenACC 'default' clause is not valid on 'loop' directive}}
#pragma acc loop default(present)
for(int i = 5; i < 10;++i);
}