1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 3
2 ;; direct-access-external-data is false due to PIC Level, so __stack_chk_guard
3 ;; is dso_preemtable. Check that we use GOT PIC code sequence as well because
4 ;; R_ARM_GOT_ABS does not have assembler support.
5 ; RUN: llc -relocation-model=static < %s | FileCheck %s
6 ; RUN: llc -relocation-model=pic < %s | FileCheck %s
8 target triple = "armv7a-linux-gnueabi"
10 define i32 @test1() #0 {
13 ; CHECK-NEXT: push {r11, lr}
14 ; CHECK-NEXT: sub sp, sp, #8
15 ; CHECK-NEXT: sub sp, sp, #1024
16 ; CHECK-NEXT: ldr r0, .LCPI0_0
17 ; CHECK-NEXT: .LPC0_0:
18 ; CHECK-NEXT: add r0, pc, r0
19 ; CHECK-NEXT: ldr r0, [r0]
20 ; CHECK-NEXT: ldr r0, [r0]
21 ; CHECK-NEXT: str r0, [sp, #1028]
22 ; CHECK-NEXT: add r0, sp, #4
24 ; CHECK-NEXT: ldr r0, [sp, #1028]
25 ; CHECK-NEXT: ldr r1, .LCPI0_1
26 ; CHECK-NEXT: .LPC0_1:
27 ; CHECK-NEXT: add r1, pc, r1
28 ; CHECK-NEXT: ldr r1, [r1]
29 ; CHECK-NEXT: ldr r1, [r1]
30 ; CHECK-NEXT: cmp r1, r0
31 ; CHECK-NEXT: moveq r0, #0
32 ; CHECK-NEXT: addeq sp, sp, #8
33 ; CHECK-NEXT: addeq sp, sp, #1024
34 ; CHECK-NEXT: popeq {r11, pc}
35 ; CHECK-NEXT: .LBB0_1:
36 ; CHECK-NEXT: bl __stack_chk_fail
37 ; CHECK-NEXT: .p2align 2
38 ; CHECK-NEXT: @ %bb.2:
39 ; CHECK-NEXT: .LCPI0_0:
41 ; CHECK-NEXT: .long __stack_chk_guard(GOT_PREL)-((.LPC0_0+8)-.Ltmp0)
42 ; CHECK-NEXT: .LCPI0_1:
44 ; CHECK-NEXT: .long __stack_chk_guard(GOT_PREL)-((.LPC0_1+8)-.Ltmp1)
45 %a1 = alloca [256 x i32], align 4
46 call void @foo(ptr %a1) #3
50 declare void @foo(ptr)
52 attributes #0 = { nounwind sspstrong }
54 !llvm.module.flags = !{!0}
55 !0 = !{i32 8, !"PIC Level", i32 2}