88 lines · c
1// RUN: %clang_cc1 %s -fopenacc -verify2 3short getS();4 5void Test() {6#pragma acc parallel async7 while(1);8#pragma acc parallel async(1)9 while(1);10#pragma acc kernels async(1)11 while(1);12#pragma acc kernels async(-51)13 while(1);14 15#pragma acc serial async(1)16 while(1);17 18 // expected-error@+2{{expected ')'}}19 // expected-note@+1{{to match this '('}}20#pragma acc serial async(1, 2)21 while(1);22 23 // expected-error@+2{{OpenACC 'async' clause cannot appear more than once on a 'kernels' directive}}24 // expected-note@+1{{previous 'async' clause is here}}25#pragma acc kernels async async26 while(1);27 28 // expected-error@+2{{OpenACC 'async' clause cannot appear more than once on a 'kernels' directive}}29 // expected-note@+1{{previous 'async' clause is here}}30#pragma acc kernels async(1) async(2)31 while(1);32 33 // expected-error@+2{{OpenACC 'async' clause cannot appear more than once on a 'parallel' directive}}34 // expected-note@+1{{previous 'async' clause is here}}35#pragma acc parallel async(1) async(2)36 while(1);37 38 // expected-error@+2{{OpenACC 'async' clause cannot appear more than once on a 'serial' directive}}39 // expected-note@+1{{previous 'async' clause is here}}40#pragma acc serial async(1) async(2)41 while(1);42 43 // expected-error@+3{{OpenACC 'async' clause cannot appear more than once in a 'device_type' region on a 'kernels' directive}}44 // expected-note@+2{{previous 'async' clause is here}}45 // expected-note@+1{{active 'device_type' clause here}}46#pragma acc kernels async(1) device_type(*) async(1) async(2)47 while(1);48 // expected-error@+3{{OpenACC 'async' clause cannot appear more than once in a 'device_type' region on a 'parallel' directive}}49 // expected-note@+2{{previous 'async' clause is here}}50 // expected-note@+1{{active 'device_type' clause here}}51#pragma acc parallel async device_type(*) async async52 while(1);53 // expected-error@+3{{OpenACC 'async' clause cannot appear more than once in a 'device_type' region on a 'serial' directive}}54 // expected-note@+2{{previous 'async' clause is here}}55 // expected-note@+1{{active 'device_type' clause here}}56#pragma acc serial async(1) device_type(*) async async(2)57 while(1);58 59 // expected-error@+3{{OpenACC 'async' clause cannot appear more than once in a 'device_type' region on a 'parallel' directive}}60 // expected-note@+2{{previous 'async' clause is here}}61 // expected-note@+1{{active 'device_type' clause here}}62#pragma acc parallel device_type(*) async async63 while(1);64 65 struct NotConvertible{} NC;66 // expected-error@+1{{OpenACC clause 'async' requires expression of integer type ('struct NotConvertible' invalid)}}67#pragma acc parallel async(NC)68 while(1);69 70#pragma acc kernels async(getS())71 while(1);72 73 struct Incomplete *SomeIncomplete;74 75 // expected-error@+1{{OpenACC clause 'async' requires expression of integer type ('struct Incomplete' invalid)}}76#pragma acc kernels async(*SomeIncomplete)77 while(1);78 79 enum E{A} SomeE;80 81#pragma acc kernels async(SomeE)82 while(1);83 84 // expected-error@+1{{OpenACC 'async' clause is not valid on 'loop' directive}}85#pragma acc loop async(1)86 for(int i = 5; i < 10;++i);87}88