1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2
2 ; RUN: opt < %s -simple-loop-unswitch-inject-invariant-conditions=true -passes='loop(simple-loop-unswitch<nontrivial>)' -S | FileCheck %s
4 @global = external dso_local local_unnamed_addr global i64, align 8
6 define dso_local void @test() local_unnamed_addr #0 {
7 ; CHECK-LABEL: define dso_local void @test() local_unnamed_addr {
9 ; CHECK-NEXT: br label [[BB1:%.*]]
11 ; CHECK-NEXT: [[CALL:%.*]] = tail call noundef ptr @widget()
12 ; CHECK-NEXT: [[ICMP:%.*]] = icmp slt ptr [[CALL]], null
13 ; CHECK-NEXT: br i1 [[ICMP]], label [[BB2:%.*]], label [[BB1]]
15 ; CHECK-NEXT: ret void
20 bb1: ; preds = %bb1, %bb
21 %call = tail call noundef ptr @widget()
22 %icmp = icmp slt ptr %call, null
23 br i1 %icmp, label %bb2, label %bb1
29 declare ptr @widget() local_unnamed_addr #0