blob: a0982be5f5621e67c97995f2c01978610ec2f0b5 [file] [log] [blame]
Akira Hatanakaba3af242014-07-25 19:47:46 +00001; RUN: llc < %s -mtriple=thumbv7-apple-ios -relocation-model=pic -no-integrated-as | FileCheck %s -check-prefix=PIC
2; RUN: llc < %s -mtriple=thumbv7-apple-ios -relocation-model=static -no-integrated-as | FileCheck %s -check-prefix=STATIC
3
4;PIC: foo2
5;PIC: movw [[R0:r[0-9]+]], :lower16:(L___stack_chk_guard$non_lazy_ptr-([[LABEL0:LPC[0-9_]+]]+4))
6;PIC: movt [[R0]], :upper16:(L___stack_chk_guard$non_lazy_ptr-([[LABEL0]]+4))
7;PIC: [[LABEL0]]:
8;PIC: add [[R0]], pc
9;PIC: ldr [[R1:r[0-9]+]], {{\[}}[[R0]]{{\]}}
10;PIC: ldr {{r[0-9]+}}, {{\[}}[[R1]]{{\]}}
11
12;STATIC: foo2
13;STATIC: movw [[R0:r[0-9]+]], :lower16:___stack_chk_guard
14;STATIC: movt [[R0]], :upper16:___stack_chk_guard
15;STATIC: ldr {{r[0-9]+}}, {{\[}}[[R0]]{{\]}}
16
17; Function Attrs: nounwind ssp
18define i32 @test_stack_guard_remat() #0 {
19 %a1 = alloca [256 x i32], align 4
20 %1 = bitcast [256 x i32]* %a1 to i8*
21 call void @llvm.lifetime.start(i64 1024, i8* %1)
22 %2 = getelementptr inbounds [256 x i32]* %a1, i32 0, i32 0
23 call void @foo3(i32* %2) #3
24 call void asm sideeffect "foo2", "~{r0},~{r1},~{r2},~{r3},~{r4},~{r5},~{r6},~{r7},~{r8},~{r9},~{r10},~{r11},~{r12},~{sp},~{lr}"()
25 call void @llvm.lifetime.end(i64 1024, i8* %1)
26 ret i32 0
27}
28
29; Function Attrs: nounwind
30declare void @llvm.lifetime.start(i64, i8* nocapture)
31
32declare void @foo3(i32*)
33
34; Function Attrs: nounwind
35declare void @llvm.lifetime.end(i64, i8* nocapture)
36
37attributes #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" }