; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5 ; RUN: llc -relocation-model=static -mattr=+no-movt < %s | FileCheck %s --check-prefix=STATIC ; RUN: llc -relocation-model=pic -mattr=+no-movt < %s | FileCheck %s --check-prefix=PIC target triple = "thumbv7a-linux-gnueabi" define i32 @test1() #0 { ; STATIC-LABEL: test1: ; STATIC: @ %bb.0: ; STATIC-NEXT: push {r7, lr} ; STATIC-NEXT: sub.w sp, sp, #1032 ; STATIC-NEXT: ldr r0, .LCPI0_0 ; STATIC-NEXT: ldr r0, [r0] ; STATIC-NEXT: str.w r0, [sp, #1028] ; STATIC-NEXT: add r0, sp, #4 ; STATIC-NEXT: bl foo ; STATIC-NEXT: ldr.w r0, [sp, #1028] ; STATIC-NEXT: ldr r1, .LCPI0_0 ; STATIC-NEXT: ldr r1, [r1] ; STATIC-NEXT: cmp r1, r0 ; STATIC-NEXT: ittt eq ; STATIC-NEXT: moveq r0, #0 ; STATIC-NEXT: addeq.w sp, sp, #1032 ; STATIC-NEXT: popeq {r7, pc} ; STATIC-NEXT: .LBB0_1: ; STATIC-NEXT: bl __stack_chk_fail ; STATIC-NEXT: .p2align 2 ; STATIC-NEXT: @ %bb.2: ; STATIC-NEXT: .LCPI0_0: ; STATIC-NEXT: .long __stack_chk_guard ; ; PIC-LABEL: test1: ; PIC: @ %bb.0: ; PIC-NEXT: push {r7, lr} ; PIC-NEXT: sub.w sp, sp, #1032 ; PIC-NEXT: ldr r0, .LCPI0_0 ; PIC-NEXT: .LPC0_0: ; PIC-NEXT: add r0, pc ; PIC-NEXT: ldr r0, [r0] ; PIC-NEXT: str.w r0, [sp, #1028] ; PIC-NEXT: add r0, sp, #4 ; PIC-NEXT: bl foo ; PIC-NEXT: ldr.w r0, [sp, #1028] ; PIC-NEXT: ldr r1, .LCPI0_1 ; PIC-NEXT: .LPC0_1: ; PIC-NEXT: add r1, pc ; PIC-NEXT: ldr r1, [r1] ; PIC-NEXT: cmp r1, r0 ; PIC-NEXT: ittt eq ; PIC-NEXT: moveq r0, #0 ; PIC-NEXT: addeq.w sp, sp, #1032 ; PIC-NEXT: popeq {r7, pc} ; PIC-NEXT: .LBB0_1: ; PIC-NEXT: bl __stack_chk_fail ; PIC-NEXT: .p2align 2 ; PIC-NEXT: @ %bb.2: ; PIC-NEXT: .LCPI0_0: ; PIC-NEXT: .long __stack_chk_guard-(.LPC0_0+4) ; PIC-NEXT: .LCPI0_1: ; PIC-NEXT: .long __stack_chk_guard-(.LPC0_1+4) %a1 = alloca [256 x i32], align 4 call void @foo(ptr %a1) #3 ret i32 0 } declare void @foo(ptr) attributes #0 = { nounwind sspstrong }