xref: /llvm-project/llvm/test/CodeGen/ARM/stack-guard-rwpi.ll (revision e018cbf7208b3d34f18997ddee84c66cee32fb1b)
1; RUN: llc -mtriple=arm-- --relocation-model=rwpi %s -o - | \
2; RUN: FileCheck %s --check-prefixes=RWPI
3; RUN: llc -mtriple=arm-- --relocation-model=ropi %s -o - | \
4; RUN: FileCheck %s --check-prefixes=ROPI
5; RUN: llc -mtriple=arm-- --relocation-model=pic %s -o - | \
6; RUN: FileCheck %s --check-prefixes=PIC
7
8; RWPI:        ldr     {{r[0-9]+}}, .LCPI0_0
9; RWPI:        .LCPI0_0:
10; RWPI-NEXT:           .long   __stack_chk_guard(sbrel)
11
12; ROPI:        ldr     {{r[0-9]+}}, .LCPI0_0
13; ROPI:        .LCPI0_0:
14; ROPI-NEXT:           .long   __stack_chk_guard
15
16; PIC:         ldr     {{r[0-9]+}}, .LCPI0_0
17; PIC:         .LCPI0_0:
18; PIC-NEXT:    .Ltmp0:
19; PIC-NEXT:            .long   __stack_chk_guard(GOT_PREL)-((.LPC0_0+8)-.Ltmp0)
20
21define dso_local i32 @foo(i32 %t) nounwind sspstrong {
22entry:
23  %vla = alloca i32, i32 %t
24  %call = call i32 @baz(ptr %vla)
25  ret i32 %call
26}
27
28declare dso_local i32 @baz(ptr)
29
30!llvm.module.flags = !{!0}
31!0 = !{i32 7, !"PIC Level", i32 2}
32