44 lines · cpp
1// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++17 -emit-llvm %s -triple x86_64-linux -fexceptions -fcxx-exceptions -o - -femit-all-decls -disable-llvm-passes | FileCheck %s2// RUN: %clang_cc1 -fopenmp -x c++ -std=c++17 -triple x86_64-linux -fexceptions -fcxx-exceptions -emit-pch -o %t %s -femit-all-decls -disable-llvm-passes3// RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-linux -fexceptions -fcxx-exceptions -std=c++17 -include-pch %t -verify %s -emit-llvm -o - -femit-all-decls -disable-llvm-passes | FileCheck %s4 5// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++17 -emit-llvm %s -triple x86_64-linux -fexceptions -fcxx-exceptions -o - -femit-all-decls -disable-llvm-passes | FileCheck --check-prefix SIMD-ONLY0 %s6// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++17 -triple x86_64-linux -fexceptions -fcxx-exceptions -emit-pch -o %t %s -femit-all-decls -disable-llvm-passes7// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple x86_64-linux -fexceptions -fcxx-exceptions -std=c++17 -include-pch %t -verify %s -emit-llvm -o - -femit-all-decls -disable-llvm-passes | FileCheck --check-prefix SIMD-ONLY0 %s8// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}9// expected-no-diagnostics10 11// CHECK: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @{{.+}}, i32 1, ptr [[OUTLINED:@.+]], ptr %{{.+}})12 13// CHECK: define internal void [[OUTLINED]](ptr noalias noundef %{{.+}}, ptr noalias noundef %{{.+}}, ptr {{.+}})14// CHECK: call i32 @__kmpc_reduce_nowait(ptr15 16#ifndef HEADER17#define HEADER18 19typedef decltype(sizeof 0) a;20namespace std {21template <class> class initializer_list {22 const int *b;23 a c;24};25template <typename, typename> class d {};26template <typename e> class f {27public:28 f(initializer_list<e>);29};30} // namespace std31template <class g, class h> void foo(g, h) {32 std::d<a, double> i;33#pragma omp declare reduction(j : std::d <a, double> : []{}())34#pragma omp parallel reduction(j : i)35 ;36}37void k() {38 std::f<int> l{};39 std::f<int> m{2};40 foo(l, m);41}42 43#endif // HEADER44