[LLVM][IR] Use splat syntax when printing ConstantExpr based splats. (#116856)
[llvm-project.git] / llvm / test / CodeGen / Thumb / stack_guard_remat.ll
blobcc142392981d65482a660a57002a9a8e8c39983a
1 ; RUN: cat %s > %t.pic.ll
2 ; RUN: echo -e '!llvm.module.flags = !{!0}\n!0 = !{i32 7, !"PIC Level", i32 2}' >> %t.pic.ll
3 ; RUN: llc < %t.pic.ll -mtriple=thumb-apple-darwin -relocation-model=pic -no-integrated-as | FileCheck %s -check-prefix=PIC
4 ; RUN: llc < %s -mtriple=thumb-apple-darwin -relocation-model=static -no-integrated-as | FileCheck %s -check-prefix=NO-PIC  -check-prefix=STATIC
5 ; 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
7 ;PIC:        foo2
8 ;PIC:        add [[SAVED_GUARD:r[0-9]+]], sp, #904
9 ;PIC-NEXT:   ldr [[SAVED_GUARD]], [[[SAVED_GUARD]], #124]
10 ;PIC-NEXT:   ldr [[ORIGINAL_GUARD:r[0-9]+]], [[ORIGINAL_GUARD_LABEL:LCPI[0-9_]+]]
11 ;PIC-NEXT: [[LABEL1:LPC[0-9_]+]]:
12 ;PIC-NEXT:   add [[ORIGINAL_GUARD]], pc
13 ;PIC-NEXT:   ldr [[ORIGINAL_GUARD]], [[[ORIGINAL_GUARD]]]
14 ;PIC-NEXT:   ldr [[ORIGINAL_GUARD]], [[[ORIGINAL_GUARD]]]
15 ;PIC-NEXT:   cmp [[ORIGINAL_GUARD]], [[SAVED_GUARD]]
17 ;PIC:      [[ORIGINAL_GUARD_LABEL]]:
18 ;PIC-NEXT:   .long L___stack_chk_guard$non_lazy_ptr-([[LABEL1]]+4)
20 ;NO-PIC:   foo2
21 ;NO-PIC:                add [[SAVED_GUARD:r[0-9]+]], sp, #904
22 ;NO-PIC-NEXT:           ldr [[SAVED_GUARD]], [[[SAVED_GUARD]], #124]
23 ;NO-PIC-NEXT:           ldr [[ORIGINAL_GUARD:r[0-9]+]], [[ORIGINAL_GUARD_LABEL:LCPI[0-9_]+]]
24 ;DYNAMIC-NO-PIC:        add [[ORIGINAL_GUARD]], pc
25 ;NO-PIC-NEXT:           ldr [[ORIGINAL_GUARD]], [[[ORIGINAL_GUARD]]]
26 ;DYNAMIC-NO-PIC-NEXT:   ldr [[ORIGINAL_GUARD]], [[[ORIGINAL_GUARD]]]
27 ;NO-PIC-NEXT:           cmp [[ORIGINAL_GUARD]], [[SAVED_GUARD]]
29 ;STATIC:      [[ORIGINAL_GUARD_LABEL]]:
30 ;STATIC-NEXT:   .long ___stack_chk_guard
32 ;DYNAMIC-NO-PIC:      [[ORIGINAL_GUARD_LABEL]]:
33 ;DYNAMIC-NO-PIC-NEXT:   .long L___stack_chk_guard$non_lazy_ptr
35 ; Function Attrs: nounwind ssp
36 define i32 @test_stack_guard_remat() #0 {
37   %a1 = alloca [256 x i32], align 4
38   call void @llvm.lifetime.start.p0(i64 1024, ptr %a1)
39   call void @foo3(ptr %a1) #3
40   call void asm sideeffect "foo2", "~{r0},~{r1},~{r2},~{r3},~{r4},~{r5},~{r6},~{r7},~{r8},~{r9},~{r10},~{r11},~{r12},~{sp},~{lr}"()
41   call void @llvm.lifetime.end.p0(i64 1024, ptr %a1)
42   ret i32 0
45 ; Function Attrs: nounwind
46 declare void @llvm.lifetime.start.p0(i64, ptr nocapture)
48 declare void @foo3(ptr)
50 ; Function Attrs: nounwind
51 declare void @llvm.lifetime.end.p0(i64, ptr nocapture)
53 attributes #0 = { nounwind ssp "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }