Akira Hatanaka | ba3af24 | 2014-07-25 19:47:46 +0000 | [diff] [blame] | 1 | ; RUN: llc < %s -mtriple=thumb-apple-darwin -relocation-model=pic -no-integrated-as | FileCheck %s -check-prefix=PIC |
Akira Hatanaka | dc08c30 | 2014-08-02 05:40:40 +0000 | [diff] [blame] | 2 | ; RUN: llc < %s -mtriple=thumb-apple-darwin -relocation-model=static -no-integrated-as | FileCheck %s -check-prefix=NO-PIC -check-prefix=STATIC |
| 3 | ; RUN: llc < %s -mtriple=thumb-apple-darwin -relocation-model=dynamic-no-pic -no-integrated-as | FileCheck %s -check-prefix=NO-PIC -check-prefix=DYNAMIC-NO-PIC |
Akira Hatanaka | ba3af24 | 2014-07-25 19:47:46 +0000 | [diff] [blame] | 4 | |
| 5 | ;PIC: foo2 |
| 6 | ;PIC: ldr [[R0:r[0-9]+]], [[LABEL0:LCPI[0-9_]+]] |
| 7 | ;PIC: [[LABEL1:LPC[0-9_]+]]: |
| 8 | ;PIC: add [[R0]], pc |
| 9 | ;PIC: ldr [[R1:r[0-9]+]], {{\[}}[[R0]]{{\]}} |
| 10 | ;PIC: ldr [[R1:r[0-9]+]], {{\[}}[[R1]]{{\]}} |
| 11 | |
| 12 | ;PIC: [[LABEL0]]: |
| 13 | ;PIC-NEXT: .long L___stack_chk_guard$non_lazy_ptr-([[LABEL1]]+4) |
| 14 | |
Akira Hatanaka | dc08c30 | 2014-08-02 05:40:40 +0000 | [diff] [blame] | 15 | ;NO-PIC: foo2 |
| 16 | ;NO-PIC: ldr [[R0:r[0-9]+]], [[LABEL0:LCPI[0-9_]+]] |
| 17 | ;NO-PIC-NOT: LPC |
| 18 | ;NO-PIC: ldr {{r[0-9]+}}, {{\[}}[[R0]]{{\]}} |
Akira Hatanaka | ba3af24 | 2014-07-25 19:47:46 +0000 | [diff] [blame] | 19 | |
| 20 | ;STATIC: [[LABEL0]]: |
| 21 | ;STATIC-NEXT: .long ___stack_chk_guard |
| 22 | |
Akira Hatanaka | dc08c30 | 2014-08-02 05:40:40 +0000 | [diff] [blame] | 23 | ;DYNAMIC-NO-PIC: [[LABEL0]]: |
| 24 | ;DYNAMIC-NO-PIC-NEXT: .long L___stack_chk_guard$non_lazy_ptr |
| 25 | |
Akira Hatanaka | ba3af24 | 2014-07-25 19:47:46 +0000 | [diff] [blame] | 26 | ; Function Attrs: nounwind ssp |
| 27 | define i32 @test_stack_guard_remat() #0 { |
| 28 | %a1 = alloca [256 x i32], align 4 |
| 29 | %1 = bitcast [256 x i32]* %a1 to i8* |
| 30 | call void @llvm.lifetime.start(i64 1024, i8* %1) |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame^] | 31 | %2 = getelementptr inbounds [256 x i32], [256 x i32]* %a1, i32 0, i32 0 |
Akira Hatanaka | ba3af24 | 2014-07-25 19:47:46 +0000 | [diff] [blame] | 32 | call void @foo3(i32* %2) #3 |
| 33 | call void asm sideeffect "foo2", "~{r0},~{r1},~{r2},~{r3},~{r4},~{r5},~{r6},~{r7},~{r8},~{r9},~{r10},~{r11},~{r12},~{sp},~{lr}"() |
| 34 | call void @llvm.lifetime.end(i64 1024, i8* %1) |
| 35 | ret i32 0 |
| 36 | } |
| 37 | |
| 38 | ; Function Attrs: nounwind |
| 39 | declare void @llvm.lifetime.start(i64, i8* nocapture) |
| 40 | |
| 41 | declare void @foo3(i32*) |
| 42 | |
| 43 | ; Function Attrs: nounwind |
| 44 | declare void @llvm.lifetime.end(i64, i8* nocapture) |
| 45 | |
| 46 | attributes #0 = { nounwind ssp "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } |