[NFC][SimplifyCFG] Add a test with an undef cond branch to identical destinations
authorRoman Lebedev <lebedev.ri@gmail.com>
Thu, 7 Jan 2021 21:10:50 +0000 (00:10 +0300)
committerRoman Lebedev <lebedev.ri@gmail.com>
Thu, 7 Jan 2021 23:15:26 +0000 (02:15 +0300)
llvm/test/Transforms/SimplifyCFG/change-to-unreachable-matching-successor.ll [new file with mode: 0644]

diff --git a/llvm/test/Transforms/SimplifyCFG/change-to-unreachable-matching-successor.ll b/llvm/test/Transforms/SimplifyCFG/change-to-unreachable-matching-successor.ll
new file mode 100644 (file)
index 0000000..4fd017d
--- /dev/null
@@ -0,0 +1,16 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; RUN: opt -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S < %s | FileCheck %s
+
+declare void @llvm.assume(i1)
+
+define void @fn(i1 %c) {
+; CHECK-LABEL: @fn(
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    unreachable
+;
+entry:
+  call void @llvm.assume(i1 undef)
+  br i1 %c, label %bb1, label %bb1
+bb1:
+  ret void
+}