1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=armv7-apple-ios -mcpu=cortex-a8 | FileCheck %s -check-prefix=A8
3 ; RUN: llc < %s -mtriple=armv7-apple-ios -mcpu=swift | FileCheck %s -check-prefix=SWIFT
6 @x = external global ptr ; <ptr> [#uses=1]
8 define void @foo(i32 %a) "frame-pointer"="all" {
10 ; A8: @ %bb.0: @ %entry
11 ; A8-NEXT: movw r1, :lower16:(L_x$non_lazy_ptr-(LPC0_0+8))
12 ; A8-NEXT: movt r1, :upper16:(L_x$non_lazy_ptr-(LPC0_0+8))
14 ; A8-NEXT: ldr r1, [pc, r1]
15 ; A8-NEXT: ldr r1, [r1]
16 ; A8-NEXT: str r0, [r1]
20 ; SWIFT: @ %bb.0: @ %entry
21 ; SWIFT-NEXT: movw r1, :lower16:(L_x$non_lazy_ptr-(LPC0_0+8))
22 ; SWIFT-NEXT: movt r1, :upper16:(L_x$non_lazy_ptr-(LPC0_0+8))
24 ; SWIFT-NEXT: ldr r1, [pc, r1]
25 ; SWIFT-NEXT: ldr r1, [r1]
26 ; SWIFT-NEXT: str r0, [r1]
29 %tmp = load ptr, ptr @x ; <ptr> [#uses=1]
30 store i32 %a, ptr %tmp
34 define i32 @t1(i32 %a, i32 %b) "frame-pointer"="all" {
36 ; A8: @ %bb.0: @ %entry
39 ; A8-NEXT: cmp r2, #10
41 ; A8-NEXT: LBB1_1: @ %cond_true
42 ; A8-NEXT: push {r7, lr}
47 ; A8-NEXT: pop {r7, lr}
51 ; SWIFT: @ %bb.0: @ %entry
52 ; SWIFT-NEXT: mov r2, r0
53 ; SWIFT-NEXT: mov r0, #1
54 ; SWIFT-NEXT: cmp r2, #10
56 ; SWIFT-NEXT: LBB1_1: @ %cond_true
57 ; SWIFT-NEXT: push {r7, lr}
58 ; SWIFT-NEXT: mov r7, sp
59 ; SWIFT-NEXT: mov r0, r1
61 ; SWIFT-NEXT: mov r0, #0
62 ; SWIFT-NEXT: pop {r7, lr}
65 %tmp1 = icmp sgt i32 %a, 10 ; <i1> [#uses=1]
66 br i1 %tmp1, label %cond_true, label %UnifiedReturnBlock
68 cond_true: ; preds = %entry
69 tail call void @foo( i32 %b )
72 UnifiedReturnBlock: ; preds = %entry