xref: /llvm-project/llvm/test/Transforms/InstCombine/malloc-free-delete-dbginvar.ll (revision 5fb9e840476d531cb5377c69941f2ccfe4145475)
1; Check that the instcombine result is the same with/without debug info.
2; This is a regression test for a function taken from malloc-free-delete.ll.
3
4; RUN: opt < %s -passes=instcombine -S > %t.no_dbg.ll
5; RUN: opt < %s -debugify-each -passes=instcombine -S > %t.ll
6; RUN: diff %t.no_dbg.ll %t.ll
7
8declare void @free(ptr)
9
10define void @test12(ptr %foo) minsize {
11entry:
12  %tobool = icmp eq ptr %foo, null
13  br i1 %tobool, label %if.end, label %if.then
14
15if.then:                                          ; preds = %entry
16  tail call void @free(ptr %foo)
17  br label %if.end
18
19if.end:                                           ; preds = %entry, %if.then
20  ret void
21}
22