1*532dc62bSNikita Popov // RUN: %clang_cc1 -no-opaque-pointers -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 %s
2*532dc62bSNikita Popov // RUN: %clang_cc1 -no-opaque-pointers -fopenmp -x c++ -std=c++17 -triple x86_64-linux -fexceptions -fcxx-exceptions -emit-pch -o %t %s -femit-all-decls -disable-llvm-passes
3*532dc62bSNikita Popov // RUN: %clang_cc1 -no-opaque-pointers -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 %s
4a913e872SAlexey Bataev
5*532dc62bSNikita Popov // RUN: %clang_cc1 -no-opaque-pointers -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 %s
6*532dc62bSNikita Popov // RUN: %clang_cc1 -no-opaque-pointers -fopenmp-simd -x c++ -std=c++17 -triple x86_64-linux -fexceptions -fcxx-exceptions -emit-pch -o %t %s -femit-all-decls -disable-llvm-passes
7*532dc62bSNikita Popov // RUN: %clang_cc1 -no-opaque-pointers -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 %s
8a913e872SAlexey Bataev // SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
9a913e872SAlexey Bataev // expected-no-diagnostics
10a913e872SAlexey Bataev
11a913e872SAlexey Bataev // CHECK: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @{{.+}}, i32 1, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, [[STD_D:%.+]]*)* [[OUTLINED:@.+]] to void (i32*, i32*, ...)*), [[STD_D]]* %{{.+}})
12a913e872SAlexey Bataev
131b1c8d83Shyeongyu kim // CHECK: define internal void [[OUTLINED]](i32* noalias noundef %{{.+}}, i32* noalias noundef %{{.+}}, [[STD_D]]* {{.+}})
14a913e872SAlexey Bataev // CHECK: call i32 @__kmpc_reduce_nowait(%struct.ident_t*
15a913e872SAlexey Bataev
16a913e872SAlexey Bataev #ifndef HEADER
17a913e872SAlexey Bataev #define HEADER
18a913e872SAlexey Bataev
19a913e872SAlexey Bataev typedef long unsigned a;
20a913e872SAlexey Bataev namespace std {
21a913e872SAlexey Bataev template <class> class initializer_list {
22a913e872SAlexey Bataev const int *b;
23a913e872SAlexey Bataev a c;
24a913e872SAlexey Bataev };
25a913e872SAlexey Bataev template <typename, typename> class d {};
26a913e872SAlexey Bataev template <typename e> class f {
27a913e872SAlexey Bataev public:
28a913e872SAlexey Bataev f(initializer_list<e>);
29a913e872SAlexey Bataev };
30a913e872SAlexey Bataev } // namespace std
foo(g,h)31a913e872SAlexey Bataev template <class g, class h> void foo(g, h) {
32a913e872SAlexey Bataev std::d<a, double> i;
33a913e872SAlexey Bataev #pragma omp declare reduction(j : std::d <a, double> : []{}())
34a913e872SAlexey Bataev #pragma omp parallel reduction(j : i)
35a913e872SAlexey Bataev ;
36a913e872SAlexey Bataev }
k()37a913e872SAlexey Bataev void k() {
38a913e872SAlexey Bataev std::f<int> l{};
39a913e872SAlexey Bataev std::f<int> m{2};
40a913e872SAlexey Bataev foo(l, m);
41a913e872SAlexey Bataev }
42a913e872SAlexey Bataev
43a913e872SAlexey Bataev #endif // HEADER
44