llvm-project/clang/test/SemaOpenACC/data-construct-if-clause.c
erichkeane 8313d2a8db [OpenACC] Fixup previous-clause diagnostics
Brought up in a previous review as a TODO, we could be better about how
we highlight what hte previous clause was, and how to show that the
'device_type' is the one being targetted.  This patch rewords the
diagnostics and updates a massive number of tests.
2025-05-02 09:35:32 -07:00

30 lines
1.0 KiB
C

// RUN: %clang_cc1 %s -fopenacc -verify
void Foo() {
int Var;
#pragma acc data default(present) if(1)
;
// expected-error@+2{{OpenACC 'if' clause cannot appear more than once on a 'data' directive}}
// expected-note@+1{{previous 'if' clause is here}}
#pragma acc data default(present) if(1) if (2)
;
#pragma acc enter data copyin(Var) if(1)
// expected-error@+2{{OpenACC 'if' clause cannot appear more than once on a 'enter data' directive}}
// expected-note@+1{{previous 'if' clause is here}}
#pragma acc enter data copyin(Var) if(1) if (2)
#pragma acc exit data copyout(Var) if(1)
// expected-error@+2{{OpenACC 'if' clause cannot appear more than once on a 'exit data' directive}}
// expected-note@+1{{previous 'if' clause is here}}
#pragma acc exit data copyout(Var) if(1) if (2)
#pragma acc host_data use_device(Var) if(1)
;
// expected-error@+2{{OpenACC 'if' clause cannot appear more than once on a 'host_data' directive}}
// expected-note@+1{{previous 'if' clause is here}}
#pragma acc host_data use_device(Var) if(1) if (2)
;
}