summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms
diff options
context:
space:
mode:
authorDehao Chen <dehao@google.com>2016-09-08 16:53:40 +0000
committerDehao Chen <dehao@google.com>2016-09-08 16:53:40 +0000
commitebb715b119d241f97e24284f0d1c4afd584bf146 (patch)
tree36b675f20bbc151e276eca1ef77843ec678c8d31 /llvm/test/Transforms
parent490ccc9cc71e714f85e239913cbbcc1797c85fb8 (diff)
downloadbcm5719-llvm-ebb715b119d241f97e24284f0d1c4afd584bf146.tar.gz
bcm5719-llvm-ebb715b119d241f97e24284f0d1c4afd584bf146.zip
Add unittest for r280760
llvm-svn: 280963
Diffstat (limited to 'llvm/test/Transforms')
-rw-r--r--llvm/test/Transforms/InstSimplify/require-dominator.ll31
1 files changed, 31 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstSimplify/require-dominator.ll b/llvm/test/Transforms/InstSimplify/require-dominator.ll
new file mode 100644
index 00000000000..ce24cc8a1de
--- /dev/null
+++ b/llvm/test/Transforms/InstSimplify/require-dominator.ll
@@ -0,0 +1,31 @@
+; RUN: opt < %s -instsimplify
+
+; instsimplify pass should explicitly require DominatorTreeAnalysis
+; This test will segfault if DominatorTree is not available
+
+target triple = "x86_64-grtev4-linux-gnu"
+
+; Function Attrs: nounwind uwtable
+define void @foo(i16 *) #1 align 2 {
+ br i1 undef, label %exit, label %2
+
+; <label>:2:
+ %3 = tail call i8* @_Znwm(i64 56) #10
+ %4 = bitcast i8* %3 to i16*
+ %p = load i16*, i16** undef, align 8
+ %5 = icmp eq i16* %p, %4
+ br i1 %5, label %exit, label %6
+
+; <label>:6:
+ %7 = icmp eq i16* %p, null
+ br i1 %7, label %exit, label %8
+
+; <label>:8:
+ br label %exit
+
+exit:
+ ret void
+}
+
+; Function Attrs: nobuiltin
+declare i8* @_Znwm(i64)
OpenPOWER on IntegriCloud