summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/MergeFunc
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2013-01-10 23:22:53 +0000
committerEvan Cheng <evan.cheng@apple.com>2013-01-10 23:22:53 +0000
commit098d7b76b0105f413df9e748a42a35fdc09733c0 (patch)
treee658bd3ee3aef04a36ba56895003b619c79eaa0a /llvm/test/Transforms/MergeFunc
parent2e64aeda89bf9a901870718a7c3b59effbf7f068 (diff)
downloadbcm5719-llvm-098d7b76b0105f413df9e748a42a35fdc09733c0.tar.gz
bcm5719-llvm-098d7b76b0105f413df9e748a42a35fdc09733c0.zip
CastInst::castIsValid should return true if the dest type is the same as
Value's current type. The casting is trivial even for aggregate type. llvm-svn: 172143
Diffstat (limited to 'llvm/test/Transforms/MergeFunc')
-rw-r--r--llvm/test/Transforms/MergeFunc/2013-01-10-MergeFuncAssert.ll36
1 files changed, 36 insertions, 0 deletions
diff --git a/llvm/test/Transforms/MergeFunc/2013-01-10-MergeFuncAssert.ll b/llvm/test/Transforms/MergeFunc/2013-01-10-MergeFuncAssert.ll
new file mode 100644
index 00000000000..3f6a5ba157d
--- /dev/null
+++ b/llvm/test/Transforms/MergeFunc/2013-01-10-MergeFuncAssert.ll
@@ -0,0 +1,36 @@
+; RUN: opt -mergefunc -disable-output < %s
+; This used to trigger a ConstantExpr::getBitCast assertion.
+
+define void @t1() unnamed_addr uwtable ssp align 2 {
+entry:
+ switch i32 undef, label %sw.bb12 [
+ i32 127, label %sw.bb
+ i32 126, label %sw.bb4
+ ]
+
+sw.bb: ; preds = %entry
+ unreachable
+
+sw.bb4: ; preds = %entry
+ unreachable
+
+sw.bb12: ; preds = %entry
+ ret void
+}
+
+define void @t2() unnamed_addr uwtable ssp align 2 {
+entry:
+ switch i32 undef, label %sw.bb8 [
+ i32 4, label %sw.bb
+ i32 3, label %sw.bb4
+ ]
+
+sw.bb: ; preds = %entry
+ unreachable
+
+sw.bb4: ; preds = %entry
+ ret void
+
+sw.bb8: ; preds = %entry
+ unreachable
+}
OpenPOWER on IntegriCloud