LLVM OpenMP
foreach.cpp
Go to the documentation of this file.
1// RUN: %libomp-cxx-compile -fopenmp-version=60 && %libomp-run \
2// RUN: | FileCheck %s --match-full-lines
3
4#include <cstdlib>
5#include <cstdio>
6#include <vector>
7
8int main() {
9 std::vector<int> v = {10, 20, 30, 40, 50, 60};
10 printf("do\n");
11#pragma omp split counts(2, omp_fill)
12 for (int x : v)
13 printf("x=%d\n", x);
14 printf("done\n");
15 return EXIT_SUCCESS;
16}
17
18// CHECK: do
19// CHECK-NEXT: x=10
20// CHECK-NEXT: x=20
21// CHECK-NEXT: x=30
22// CHECK-NEXT: x=40
23// CHECK-NEXT: x=50
24// CHECK-NEXT: x=60
25// CHECK-NEXT: done
int main()
Definition foreach.cpp:11