xref: /llvm-project/llvm/test/Transforms/InstCombine/select-load-call.ll (revision 4ab40eca080965c65802710e39adbb78c4ce7bde)
1; RUN: opt < %s -passes=instcombine -S | grep "ret i32 1"
2
3declare void @test2()
4
5define i32 @test(i1 %cond, ptr %P) {
6  %A = alloca i32
7  store i32 1, ptr %P
8  store i32 1, ptr %A
9
10  call void @test2() readonly
11
12  %P2 = select i1 %cond, ptr %P, ptr %A
13  %V = load i32, ptr %P2
14  ret i32 %V
15}
16