diff options
Diffstat (limited to 'clang/test/OpenMP/declare_reduction_codegen.cpp')
-rw-r--r-- | clang/test/OpenMP/declare_reduction_codegen.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/clang/test/OpenMP/declare_reduction_codegen.cpp b/clang/test/OpenMP/declare_reduction_codegen.cpp index daa1fe8aaf5c..ae6e047d9483 100644 --- a/clang/test/OpenMP/declare_reduction_codegen.cpp +++ b/clang/test/OpenMP/declare_reduction_codegen.cpp @@ -9,6 +9,26 @@ // CHECK: [[SSS_INT:.+]] = type { i32 } // CHECK-LOAD: [[SSS_INT:.+]] = type { i32 } +// CHECK: add +void add(short &out, short &in) {} + +#pragma omp declare reduction(my_add : short : add(omp_out, omp_in)) + +// CHECK: define internal void @. +// CHECK: call void @{{.+}}add{{.+}}( +// CHECK: ret void + +// CHECK: foo_reduction_array +void foo_reduction_array() { + short y[1]; + // CHECK: call void (%ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call( +#pragma omp parallel for reduction(my_add : y) + for (int i = 0; i < 1; i++) { + } +} + +// CHECK: define internal void @ + #pragma omp declare reduction(+ : int, char : omp_out *= omp_in) // CHECK: define internal {{.*}}void @{{[^(]+}}(i32* noalias, i32* noalias) // CHECK: [[MUL:%.+]] = mul nsw i32 |