summaryrefslogtreecommitdiff
path: root/test/Other
diff options
context:
space:
mode:
authorHal Finkel <hfinkel@anl.gov>2013-07-10 22:51:01 +0000
committerHal Finkel <hfinkel@anl.gov>2013-07-10 22:51:01 +0000
commit10050d19e857396e65289c05ce9714e0a570deed (patch)
tree4992288578a0e5278d036a914aab6b6498b326ca /test/Other
parentb0d599334fea18023c0b219b2e7bc2beb7298ba0 (diff)
downloadllvm-10050d19e857396e65289c05ce9714e0a570deed.tar.gz
llvm-10050d19e857396e65289c05ce9714e0a570deed.tar.bz2
llvm-10050d19e857396e65289c05ce9714e0a570deed.tar.xz
Don't assert if we can't constant fold extract/insertvalue
A non-constant-foldable static initializer expression containing insertvalue or extractvalue had been causing an assert: Constants.cpp:1971: Assertion `FC && "ExtractValue constant expr couldn't be folded!"' failed. Now we report a more-sensible "Unsupported expression in static initializer" error instead. Fixes PR15417. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186044 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Other')
-rw-r--r--test/Other/nonconst-static-ev.ll8
-rw-r--r--test/Other/nonconst-static-iv.ll8
2 files changed, 16 insertions, 0 deletions
diff --git a/test/Other/nonconst-static-ev.ll b/test/Other/nonconst-static-ev.ll
new file mode 100644
index 0000000000..3e4b7bde5e
--- /dev/null
+++ b/test/Other/nonconst-static-ev.ll
@@ -0,0 +1,8 @@
+; RUN: not llc < %s 2> %t
+; RUN: FileCheck --check-prefix=CHECK-ERRORS < %t %s
+
+@0 = global i8 extractvalue ([1 x i8] select (i1 ptrtoint (i32* @1 to i1), [1 x i8] [ i8 1 ], [1 x i8] [ i8 2 ]), 0)
+@1 = external global i32
+
+; CHECK-ERRORS: Unsupported expression in static initializer: extractvalue
+
diff --git a/test/Other/nonconst-static-iv.ll b/test/Other/nonconst-static-iv.ll
new file mode 100644
index 0000000000..14db94c9a8
--- /dev/null
+++ b/test/Other/nonconst-static-iv.ll
@@ -0,0 +1,8 @@
+; RUN: not llc < %s 2> %t
+; RUN: FileCheck --check-prefix=CHECK-ERRORS < %t %s
+
+@0 = global i8 insertvalue( { i8 } select (i1 ptrtoint (i32* @1 to i1), { i8 } { i8 1 }, { i8 } { i8 2 }), i8 0, 0)
+@1 = external global i32
+
+; CHECK-ERRORS: Unsupported expression in static initializer: insertvalue
+