| 1 |
; RUN: llc < %s -mtriple=thumbv7s-apple-ios6.0.0 -verify-machineinstrs |
| 2 |
|
| 3 |
; Check to make sure the tail-call return at the end doesn't use a |
| 4 |
; callee-saved register. Register hinting from t2LDRDri was getting this |
| 5 |
; wrong. The intervening call will force allocation to try a high register |
| 6 |
; first, so the hint will attempt to fire, but must be rejected due to |
| 7 |
; not being in the allocation order for the tcGPR register class. |
| 8 |
; The machine instruction verifier will make sure that all actually worked |
| 9 |
; out the way it's supposed to. |
| 10 |
|
| 11 |
%"myclass" = type { %struct.foo } |
| 12 |
%struct.foo = type { i32, [40 x i8] } |
| 13 |
|
| 14 |
define hidden void @func(ptr %Data) nounwind ssp { |
| 15 |
%1 = getelementptr inbounds i8, ptr %Data, i32 12 |
| 16 |
tail call void @abc(ptr %1) nounwind |
| 17 |
tail call void @def(ptr %1) nounwind |
| 18 |
%2 = getelementptr inbounds i8, ptr %Data, i32 8 |
| 19 |
%3 = load ptr, ptr %2, align 4 |
| 20 |
tail call void @ghi(ptr %3) nounwind |
| 21 |
%4 = load ptr, ptr %Data, align 4 |
| 22 |
%5 = getelementptr inbounds i8, ptr %Data, i32 4 |
| 23 |
%6 = load ptr, ptr %5, align 4 |
| 24 |
%7 = icmp eq ptr %Data, null |
| 25 |
br i1 %7, label %10, label %8 |
| 26 |
|
| 27 |
; <label>:12 ; preds = %0 |
| 28 |
%9 = tail call ptr @jkl(ptr %1) nounwind |
| 29 |
tail call void @mno(ptr %Data) nounwind |
| 30 |
br label %10 |
| 31 |
|
| 32 |
; <label>:14 ; preds = %8, %0 |
| 33 |
tail call void %4(ptr %6) nounwind |
| 34 |
ret void |
| 35 |
} |
| 36 |
|
| 37 |
declare void @mno(ptr) |
| 38 |
|
| 39 |
declare void @def(ptr) |
| 40 |
|
| 41 |
declare void @abc(ptr) |
| 42 |
|
| 43 |
declare void @ghi(ptr) |
| 44 |
|
| 45 |
declare ptr @jkl(ptr) nounwind |