brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.3 KiB · 14ec74c Raw
72 lines · c
1// RUN: %clang_cc1 %s -fopenacc -verify2 3void Test() {4  int I;5  struct NotConvertible{} NC;6  // No special rules for this clause on the data constructs, so not much to7  // test that isn't covered by combined/compute.8#pragma acc data copyin(I) async(I)9  ;10#pragma acc enter data copyin(I) async(I)11#pragma acc exit data copyout(I) async(I)12  // expected-error@+1{{OpenACC 'async' clause is not valid on 'host_data' directive}}13#pragma acc host_data use_device(I) async(I)14  ;15 16  // expected-error@+1{{OpenACC clause 'async' requires expression of integer type ('struct NotConvertible' invalid)}}17#pragma acc data copyin(NC) async(NC)18  ;19  // expected-error@+1{{OpenACC clause 'async' requires expression of integer type ('struct NotConvertible' invalid)}}20#pragma acc enter data copyin(NC) async(NC)21  // expected-error@+1{{OpenACC clause 'async' requires expression of integer type ('struct NotConvertible' invalid)}}22#pragma acc exit data copyout(NC) async(NC)23  // expected-error@+1{{OpenACC clause 'async' requires expression of integer type ('struct NotConvertible' invalid)}}24#pragma acc host_data use_device(NC) async(NC)25  ;26 27  // expected-error@+2{{OpenACC 'async' clause cannot appear more than once on a 'data' directive}}28  // expected-note@+1{{previous 'async' clause is here}}29#pragma acc data copyin(I) async(I) async(I)30  ;31  // expected-error@+2{{expected ')'}}32  // expected-note@+1{{to match this '('}}33#pragma acc enter data copyin(I) async(I, I)34  //35  // expected-error@+2{{OpenACC 'async' clause cannot appear more than once on a 'data' directive}}36  // expected-note@+1{{previous 'async' clause is here}}37#pragma acc data default(none) async async38  while(1);39 40  // expected-error@+2{{OpenACC 'async' clause cannot appear more than once on a 'data' directive}}41  // expected-note@+1{{previous 'async' clause is here}}42#pragma acc data default(none) async(1) async(2)43  while(1);44 45  // expected-error@+2{{OpenACC 'async' clause cannot appear more than once on a 'data' directive}}46  // expected-note@+1{{previous 'async' clause is here}}47#pragma acc data default(none) async(1) async(2)48  while(1);49 50  // expected-error@+3{{OpenACC 'async' clause cannot appear more than once in a 'device_type' region on a 'data' directive}}51  // expected-note@+2{{previous 'async' clause is here}}52  // expected-note@+1{{active 'device_type' clause here}}53#pragma acc data default(none) async(1) device_type(*) async(1) async(2)54  while(1);55  // expected-error@+3{{OpenACC 'async' clause cannot appear more than once in a 'device_type' region on a 'data' directive}}56  // expected-note@+2{{previous 'async' clause is here}}57  // expected-note@+1{{active 'device_type' clause here}}58#pragma acc data default(none) async device_type(*) async async59  while(1);60  // expected-error@+3{{OpenACC 'async' clause cannot appear more than once in a 'device_type' region on a 'data' directive}}61  // expected-note@+2{{previous 'async' clause is here}}62  // expected-note@+1{{active 'device_type' clause here}}63#pragma acc data default(none) async(1) device_type(*) async async(2)64  while(1);65 66  // expected-error@+3{{OpenACC 'async' clause cannot appear more than once in a 'device_type' region on a 'data' directive}}67  // expected-note@+2{{previous 'async' clause is here}}68  // expected-note@+1{{active 'device_type' clause here}}69#pragma acc data default(none) device_type(*) async async70  while(1);71}72