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