LLVM OpenMP
foreach.cpp
Go to the documentation of this file.
1// RUN: %libomp-cxx-compile -fopenmp-version=61 && %libomp-run \
2// RUN: | FileCheck %s --match-full-lines
3
4#ifndef HEADER
5#define HEADER
6
7#include <cstdlib>
8#include <cstdio>
9#include <vector>
10
11int main() {
12 printf("do\n");
13 std::vector<int> outer{10, 20};
14 std::vector<int> inner{1, 2, 3};
15#pragma omp flatten
16 for (int a : outer)
17 for (int b : inner)
18 printf("a=%d b=%d\n", a, b);
19 printf("done\n");
20 return EXIT_SUCCESS;
21}
22
23#endif /* HEADER */
24
25// CHECK: do
26// CHECK-NEXT: a=10 b=1
27// CHECK-NEXT: a=10 b=2
28// CHECK-NEXT: a=10 b=3
29// CHECK-NEXT: a=20 b=1
30// CHECK-NEXT: a=20 b=2
31// CHECK-NEXT: a=20 b=3
32// CHECK-NEXT: done
int main()
Definition foreach.cpp:11
int a