blob: 93bb0358055eed2a18685e66ca640409e126f2cf [file] [log] [blame]
Manman Ren87a2adc2013-10-31 21:56:03 +00001; RUN: opt < %s -inline -S | FileCheck %s
2target triple = "x86_64-apple-darwin"
3
Manman Ren1d0b6bb2013-11-01 18:06:25 +00004; In inliner, we assume that inline asm does not throw. This testing case makes
5; sure that the inliner does not convert "call asm" to "invoke asm".
Manman Ren87a2adc2013-10-31 21:56:03 +00006; rdar://15317907
7; CHECK-LABEL: @caller
8; Make sure we are generating "call asm" instead of "invoke asm".
9; CHECK: call void asm
10; CHECK-LABEL: @callee_with_asm
David Majnemer7fddecc2015-06-17 20:52:32 +000011define void @caller() personality i8* bitcast (i32 (...)* @__objc_personality_v0 to i8*) {
Manman Ren87a2adc2013-10-31 21:56:03 +000012 br i1 undef, label %1, label %4
13
14; <label>:1
15 invoke void @callee_with_asm()
16 to label %4 unwind label %2
17
18; <label>:2
David Majnemer7fddecc2015-06-17 20:52:32 +000019 %3 = landingpad { i8*, i32 }
Manman Ren87a2adc2013-10-31 21:56:03 +000020 cleanup
21 resume { i8*, i32 } undef
22
23; <label>:4
24 ret void
25}
26
27define void @callee_with_asm() {
28 call void asm sideeffect "mov\09r7, r7\09\09@ marker for objc_retainAutoreleaseReturnValue", ""()
29 ret void
30}
31
32declare i32 @__objc_personality_v0(...)