xref: /llvm-project/llvm/test/Transforms/Inline/implicit-null-check.ll (revision 291223409c6139b5d56efc769088e23ecee44faf)
1; RUN: opt -passes=inline -inline-threshold=10 -S < %s | FileCheck %s
2
3declare void @foo()
4
5; CHECK-LABEL: @caller
6; CHECK-NOT:   %res = call i64 @callee(ptr %p)
7define i64 @caller(ptr %p) {
8  %res = call i64 @callee(ptr %p)
9  ret i64 %res
10}
11
12define i64 @callee(ptr %p) {
13  %null_check = icmp eq ptr %p, null
14  br i1 %null_check, label %is_null, label %non_null, !make.implicit !0
15
16is_null:
17  call void @foo()
18  ret i64 0
19
20non_null:
21  ret i64 1
22}
23
24!0 = !{}
25