Eric Christopher | cee313d | 2019-04-17 04:52:47 +0000 | [diff] [blame] | 1 | ; RUN: opt < %s -inline -S | FileCheck %s |
| 2 | ; RUN: opt < %s -passes='cgscc(inline)' -S | FileCheck %s |
| 3 | target triple = "x86_64-apple-darwin" |
| 4 | |
| 5 | ; 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". |
| 7 | ; 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 |
| 12 | define void @caller() personality i8* bitcast (i32 (...)* @__objc_personality_v0 to i8*) { |
| 13 | 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 |
| 20 | %3 = landingpad { i8*, i32 } |
| 21 | cleanup |
| 22 | resume { i8*, i32 } undef |
| 23 | |
| 24 | ; <label>:4 |
| 25 | ret void |
| 26 | } |
| 27 | |
| 28 | define void @callee_with_asm() { |
| 29 | call void asm sideeffect "mov\09r7, r7\09\09@ marker for objc_retainAutoreleaseReturnValue", ""() |
| 30 | ret void |
| 31 | } |
| 32 | |
| 33 | declare i32 @__objc_personality_v0(...) |