1 ; RUN: opt -S -passes=always-inline < %s | FileCheck %s
3 declare void @llvm.experimental.guard(i1, ...)
5 define i8 @callee(ptr %c_ptr) alwaysinline {
6 %c = load volatile i1, ptr %c_ptr
7 call void(i1, ...) @llvm.experimental.guard(i1 %c, i32 1) [ "deopt"(i32 1) ]
11 define void @caller_0(ptr %c, ptr %ptr) {
12 ; CHECK-LABEL: @caller_0(
14 ; CHECK: [[COND:%[^ ]+]] = load volatile i1, ptr %c
15 ; CHECK-NEXT: call void (i1, ...) @llvm.experimental.guard(i1 [[COND]], i32 1) [ "deopt"(i32 2, i32 1) ]
16 ; CHECK-NEXT: store i8 5, ptr %ptr
18 %v = call i8 @callee(ptr %c) [ "deopt"(i32 2) ]
23 define i32 @caller_1(ptr %c, ptr %ptr) personality i8 3 {
24 ; CHECK-LABEL: @caller_1(
25 ; CHECK: [[COND:%[^ ]+]] = load volatile i1, ptr %c
26 ; CHECK-NEXT: call void (i1, ...) @llvm.experimental.guard(i1 [[COND]], i32 1) [ "deopt"(i32 3, i32 1) ]
27 ; CHECK-NEXT: br label %normal
29 %v = invoke i8 @callee(ptr %c) [ "deopt"(i32 3) ] to label %normal
33 %lp = landingpad i32 cleanup