summaryrefslogtreecommitdiffstats
path: root/clang/test/OpenMP/for_codegen.cpp
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2016-06-15 11:20:48 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2016-06-15 11:20:48 +0000
commitb46cdeae9f5e94b12ca321e91ddef0974440222e (patch)
tree62b128b0c81b10883ad0382acaef3f687f68aff5 /clang/test/OpenMP/for_codegen.cpp
parent86e786bd17603b3839a8654ddae7710a63f8008d (diff)
downloadbcm5719-llvm-b46cdeae9f5e94b12ca321e91ddef0974440222e.tar.gz
bcm5719-llvm-b46cdeae9f5e94b12ca321e91ddef0974440222e.zip
[OPENMP] Fix crash for 'schedule|dist_schedule' clauses during
instantiation. Added checks for non-dependent context when trygin to capture non-constant schedule chunk expression for proper codegen of outlined functions. llvm-svn: 272775
Diffstat (limited to 'clang/test/OpenMP/for_codegen.cpp')
-rw-r--r--clang/test/OpenMP/for_codegen.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/clang/test/OpenMP/for_codegen.cpp b/clang/test/OpenMP/for_codegen.cpp
index 39fd63fea76..1d24403a09f 100644
--- a/clang/test/OpenMP/for_codegen.cpp
+++ b/clang/test/OpenMP/for_codegen.cpp
@@ -492,4 +492,25 @@ void loop_with_stmt_expr() {
// CHECK: call void @__kmpc_for_static_init_4(
// CHECK: call void @__kmpc_for_static_fini(
+
+// CHECK-LABEL: fint
+// CHECK: call {{.*}}i32 {{.*}}ftemplate
+// CHECK: ret i32
+
+// CHECK: load i16, i16*
+// CHECK: store i16 %
+// CHECK: call void {{.+}}@__kmpc_fork_call(
+// CHECK: call void @__kmpc_for_static_init_4(
+template <typename T>
+T ftemplate() {
+ short aa = 0;
+
+#pragma omp parallel for schedule(static, aa)
+ for (int i = 0; i < 100; i++) {
+ }
+ return T();
+}
+
+int fint(void) { return ftemplate<int>(); }
+
#endif // HEADER
OpenPOWER on IntegriCloud