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