mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-28 18:06:05 +00:00

I apparently missed a few other clauses as well when doing my initial implementation, so this adds tests for all, and fixes up the few that had problems. This is something that I'll do better to keep an eye on, though shouldn't be necessary once the rest of the clauses are implemented and we can remove the 'default' case.
44 lines
1.3 KiB
C
44 lines
1.3 KiB
C
// RUN: %clang_cc1 %s -fopenacc -verify
|
|
|
|
struct NotConvertible{} NC;
|
|
short getS();
|
|
int getI();
|
|
|
|
void uses() {
|
|
int arr[5];
|
|
|
|
#pragma acc parallel wait
|
|
while(1);
|
|
|
|
#pragma acc serial wait()
|
|
while(1);
|
|
|
|
#pragma acc kernels wait(getS(), getI())
|
|
while(1);
|
|
|
|
#pragma acc parallel wait(devnum:getS(): getI())
|
|
while(1);
|
|
|
|
#pragma acc parallel wait(devnum:getS(): queues: getI()) wait(devnum:getI(): queues: getS(), getI(), 5)
|
|
while(1);
|
|
|
|
// expected-error@+1{{OpenACC clause 'wait' requires expression of integer type ('struct NotConvertible' invalid)}}
|
|
#pragma acc parallel wait(devnum:NC : 5)
|
|
while(1);
|
|
|
|
// expected-error@+1{{OpenACC clause 'wait' requires expression of integer type ('struct NotConvertible' invalid)}}
|
|
#pragma acc parallel wait(devnum:5 : NC)
|
|
while(1);
|
|
|
|
// expected-error@+3{{OpenACC clause 'wait' requires expression of integer type ('int[5]' invalid)}}
|
|
// expected-error@+2{{OpenACC clause 'wait' requires expression of integer type ('int[5]' invalid)}}
|
|
// expected-error@+1{{OpenACC clause 'wait' requires expression of integer type ('struct NotConvertible' invalid)}}
|
|
#pragma acc parallel wait(devnum:arr : queues: arr, NC, 5)
|
|
while(1);
|
|
|
|
// expected-error@+2{{OpenACC 'wait' clause is not valid on 'loop' directive}}
|
|
// expected-warning@+1{{OpenACC construct 'loop' not yet implemented}}
|
|
#pragma acc loop wait
|
|
for(;;);
|
|
}
|