Implement Loop-splitting #pragma omp split construct with counts clause. Posting this PR after the revert of PR ([#183261](https://github.com/llvm/llvm-project/pull/183261)) Changes: 1. Added `openmp/runtime/test/transform/split/lit.local.cfg` 2. Enforced ICE for `counts` clause items in `SemaOpenMP.cpp` (minor change) 3. Updated tests `split_messages.cpp`, `split_omp_fill.cpp`, `split_diag_errors.c`. 4. Removed `nonconstant_count.cpp`
25 lines
492 B
C++
25 lines
492 B
C++
// RUN: %libomp-cxx-compile-and-run | FileCheck %s --match-full-lines
|
|
|
|
#include <cstdlib>
|
|
#include <cstdio>
|
|
#include <vector>
|
|
|
|
int main() {
|
|
std::vector<int> v = {10, 20, 30, 40, 50, 60};
|
|
printf("do\n");
|
|
#pragma omp split counts(2, omp_fill)
|
|
for (int x : v)
|
|
printf("x=%d\n", x);
|
|
printf("done\n");
|
|
return EXIT_SUCCESS;
|
|
}
|
|
|
|
// CHECK: do
|
|
// CHECK-NEXT: x=10
|
|
// CHECK-NEXT: x=20
|
|
// CHECK-NEXT: x=30
|
|
// CHECK-NEXT: x=40
|
|
// CHECK-NEXT: x=50
|
|
// CHECK-NEXT: x=60
|
|
// CHECK-NEXT: done
|