llvm/llvm/test/Transforms/InstCombine/pr96012.ll

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt -S -passes=instcombine < %s | FileCheck %s

target datalayout = "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128"

; Make sure we don't hang here.
define i32 @pr96012() {
; CHECK-LABEL: define i32 @pr96012() {
; CHECK-NEXT:  [[ENTRY:.*:]]
; CHECK-NEXT:    br label %[[FOR_COND:.*]]
; CHECK:       [[FOR_COND]]:
; CHECK-NEXT:    br label %[[FOR_COND]]
;
entry:
  br label %for.cond

for.cond:
  %indvar = phi i32 [ 1, %entry ], [ %shl, %for.cond ]
  %conv1 = trunc i32 %indvar to i8
  %neg = sub i8 0, %conv1
  %conv2 = zext i8 %neg to i32
  %shl = shl nuw i32 %conv2, 24
  br label %for.cond
}