From 6984781df9b584febce51b7740c8738a076f5692 Mon Sep 17 00:00:00 2001 From: Roman Lebedev Date: Fri, 8 Jan 2021 00:10:50 +0300 Subject: [PATCH] [NFC][SimplifyCFG] Add a test with an undef cond branch to identical destinations --- .../change-to-unreachable-matching-successor.ll | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 llvm/test/Transforms/SimplifyCFG/change-to-unreachable-matching-successor.ll 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 index 0000000..4fd017d --- /dev/null +++ b/llvm/test/Transforms/SimplifyCFG/change-to-unreachable-matching-successor.ll @@ -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 +} -- 2.7.4