Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / OpenMP / capturing_in_templates.cpp
blobfd16336ab476139220ed0172d7c0be7b617ad240
1 // RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -x c++ -std=c++11 -triple powerpc64le-ibm-linux-gnu -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck %s
3 // RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -x c++ -std=c++11 -triple powerpc64le-ibm-linux-gnu -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
4 // SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
6 // RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-ibm-linux-gnu -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck %s
8 // RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-ibm-linux-gnu -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
9 // SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
11 // expected-no-diagnostics
13 template <typename T1, typename T2>
14 struct pair {
15 T1 t1;
16 T2 t2;
17 pair(T1 t1, T2 t2) : t1(t1), t2(t2) {}
20 template <typename T1, typename T2>
21 pair<T1, T2> make_pair(T1 &&t1, T2 &&t2) {
22 return {t1, t2};
25 // CHECK-LABEL: @main
26 int main(int argc, char **argv) {
27 // CHECK: call i32 @__tgt_target_kernel(ptr @{{.+}}, i64 -1, i32 -1, i32 0, ptr @{{.+}}.region_id, ptr %{{.+}})
28 #pragma omp target
30 for (int i = 0; i < 64; ++i) {
31 for (int j = 0; j < 64; ++j) {
32 auto foo = make_pair(i * i, j * j);
36 return 0;
39 // CHECK: call {{.+}} @{{.*}}make_pair