erichkeane e3950a049a [OpenACC] Fix 'vector' checking when inside combined construct
For some reason when implementing 'vector' I didn't include switch
entries for the combined constructs.  I audited the rest of the uses of
this pattern, and got it right everywhere else, so I'm not sure why I
missed it here.

Fixes: #140339
2025-05-19 09:57:22 -07:00

23 lines
572 B
C++

// RUN: %clang_cc1 %s -fopenacc -verify
void foo() {
#pragma acc parallel loop
for (int i = 0; i < 5; ++i) {
#pragma acc loop vector(1)
for(int j = 0; j < 5; ++j);
}
#pragma acc serial loop
for (int i = 0; i < 5; ++i) {
// expected-error@+1{{'length' argument on 'vector' clause is not permitted on a 'loop' construct associated with a 'serial loop' compute construct}}
#pragma acc loop vector(1)
for(int j = 0; j < 5; ++j);
}
#pragma acc kernels loop
for (int i = 0; i < 5; ++i) {
#pragma acc loop vector(1)
for(int j = 0; j < 5; ++j);
}
}