62 lines · plain
1; RUN: rm -rf %t && split-file %s %t && cd %t2; RUN: cat a.ll pic.ll > b.ll3; RUN: llc < b.ll -mtriple=arm64-apple-ios -relocation-model=pic -no-integrated-as | FileCheck %s -check-prefix=DARWIN4; RUN: llc < b.ll -mtriple=arm64-apple-ios -relocation-model=static -no-integrated-as | FileCheck %s -check-prefix=DARWIN5; RUN: llc < b.ll -mtriple=aarch64-linux-gnu -relocation-model=pic -no-integrated-as | FileCheck %s -check-prefix=PIC-LINUX6; RUN: llc < a.ll -mtriple=aarch64-linux-gnu -relocation-model=static -code-model=large -no-integrated-as | FileCheck %s -check-prefix=STATIC-LARGE7; RUN: llc < a.ll -mtriple=aarch64-linux-gnu -relocation-model=static -code-model=small -no-integrated-as | FileCheck %s -check-prefix=STATIC-SMALL8 9; RUN: llc < b.ll -global-isel -global-isel-abort=2 -pass-remarks-missed=gisel* -mtriple=arm64-apple-ios -relocation-model=pic -no-integrated-as 2>&1 | FileCheck %s -check-prefixes=DARWIN,FALLBACK10; RUN: llc < b.ll -global-isel -global-isel-abort=2 -pass-remarks-missed=gisel* -mtriple=arm64-apple-ios -relocation-model=static -no-integrated-as 2>&1 | FileCheck %s -check-prefixes=DARWIN,FALLBACK11; RUN: llc < b.ll -global-isel -global-isel-abort=2 -pass-remarks-missed=gisel* -mtriple=aarch64-linux-gnu -relocation-model=pic -no-integrated-as 2>&1 | FileCheck %s -check-prefixes=PIC-LINUX,FALLBACK12; RUN: llc < a.ll -global-isel -global-isel-abort=2 -pass-remarks-missed=gisel* -mtriple=aarch64-linux-gnu -relocation-model=static -code-model=large -no-integrated-as 2>&1 | FileCheck %s -check-prefixes=STATIC-LARGE,FALLBACK13; RUN: llc < a.ll -global-isel -global-isel-abort=2 -pass-remarks-missed=gisel* -mtriple=aarch64-linux-gnu -relocation-model=static -code-model=small -no-integrated-as 2>&1 | FileCheck %s -check-prefixes=STATIC-SMALL,FALLBACK14 15; DARWIN: foo216; DARWIN: adrp [[R0:x[0-9]+]], ___stack_chk_guard@GOTPAGE17; DARWIN: ldr [[R1:x[0-9]+]], [[[R0]], ___stack_chk_guard@GOTPAGEOFF]18; DARWIN: ldr {{x[0-9]+}}, [[[R1]]]19 20; PIC-LINUX: foo221; PIC-LINUX: adrp [[R0:x[0-9]+]], :got:__stack_chk_guard22; PIC-LINUX: ldr [[R1:x[0-9]+]], [[[R0]], :got_lo12:__stack_chk_guard]23; PIC-LINUX: ldr {{x[0-9]+}}, [[[R1]]]24 25; STATIC-LARGE: foo226; STATIC-LARGE: movz [[R0:x[0-9]+]], #:abs_g0_nc:__stack_chk_guard27; STATIC-LARGE: movk [[R0]], #:abs_g1_nc:__stack_chk_guard28; STATIC-LARGE: movk [[R0]], #:abs_g2_nc:__stack_chk_guard29; STATIC-LARGE: movk [[R0]], #:abs_g3:__stack_chk_guard30; STATIC-LARGE: ldr {{x[0-9]+}}, [[[R0]]]31 32; STATIC-SMALL: foo233; STATIC-SMALL: adrp [[R0:x[0-9]+]], __stack_chk_guard34; STATIC-SMALL: ldr {{x[0-9]+}}, [[[R0]], :lo12:__stack_chk_guard]35 36; FALLBACK-NOT: remark:{{.*}}llvm.lifetime.end37; FALLBACK-NOT: remark:{{.*}}llvm.lifetime.start38;--- a.ll39define i32 @test_stack_guard_remat() #0 {40entry:41 %a1 = alloca [256 x i32], align 442 call void @llvm.lifetime.start.p0(i64 1024, ptr %a1)43 call void @foo3(ptr %a1)44 call void asm sideeffect "foo2", "~{w0},~{w1},~{w2},~{w3},~{w4},~{w5},~{w6},~{w7},~{w8},~{w9},~{w10},~{w11},~{w12},~{w13},~{w14},~{w15},~{w16},~{w17},~{w18},~{w19},~{w20},~{w21},~{w22},~{w23},~{w24},~{w25},~{w26},~{w27},~{w28},~{w29},~{w30}"()45 call void @llvm.lifetime.end.p0(i64 1024, ptr %a1)46 ret i32 047}48 49; Function Attrs: nounwind50declare void @llvm.lifetime.start.p0(i64, ptr nocapture)51 52declare void @foo3(ptr)53 54; Function Attrs: nounwind55declare void @llvm.lifetime.end.p0(i64, ptr nocapture)56 57attributes #0 = { nounwind sspstrong "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "use-soft-float"="false" }58 59;--- pic.ll60!llvm.module.flags = !{!0}61!0 = !{i32 8, !"PIC Level", i32 2}62