summaryrefslogtreecommitdiffstats
path: root/test/OpenMP/declare_reduction_codegen.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/OpenMP/declare_reduction_codegen.cpp')
-rw-r--r--test/OpenMP/declare_reduction_codegen.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/OpenMP/declare_reduction_codegen.cpp b/test/OpenMP/declare_reduction_codegen.cpp
index daa1fe8aaf..ae6e047d94 100644
--- a/test/OpenMP/declare_reduction_codegen.cpp
+++ b/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