xref: /llvm-project/llvm/test/Transforms/SCCP/2004-12-10-UndefBranchBug.ll (revision 9bf6365237f3a8a401afc0a69d2fb6d1b809ce68)
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2; RUN: opt < %s -passes=sccp -S | FileCheck %s
3
4; Branch on poison is UB, so the T block is never executed, and we can return
5; undef (IPSCCP would replace the block with unreachable).
6
7define i32 @foo() {
8; CHECK-LABEL: @foo(
9; CHECK-NEXT:    unreachable
10;
11  br i1 poison, label %T, label %T
12T:
13  %X = add i32 0, 1
14  ret i32 %X
15}
16
17