89 lines · plain
1; RUN: llc -mtriple=aarch64-none-linux-gnu -asm-verbose=false -global-isel=0 -fast-isel=0 \2; RUN: -relocation-model=pic -mattr=+pauth -mattr=+fpac -o - %s | FileCheck --check-prefixes=CHECK,NOTRAP %s3; RUN: llc -mtriple=aarch64-none-linux-gnu -asm-verbose=false -global-isel=0 -fast-isel=0 \4; RUN: -relocation-model=pic -mattr=+pauth -o - %s | FileCheck --check-prefixes=CHECK,TRAP %s5 6; RUN: llc -mtriple=aarch64-none-linux-gnu -asm-verbose=false -global-isel=0 -fast-isel=1 \7; RUN: -relocation-model=pic -mattr=+pauth -mattr=+fpac -o - %s | FileCheck --check-prefixes=CHECK,NOTRAP %s8; RUN: llc -mtriple=aarch64-none-linux-gnu -asm-verbose=false -global-isel=0 -fast-isel=1 \9; RUN: -relocation-model=pic -mattr=+pauth -o - %s | FileCheck --check-prefixes=CHECK,TRAP %s10 11; RUN: llc -mtriple=aarch64-none-linux-gnu -asm-verbose=false -global-isel=1 -global-isel-abort=1 \12; RUN: -relocation-model=pic -mattr=+pauth -mattr=+fpac -o - %s | FileCheck --check-prefixes=CHECK,NOTRAP %s13; RUN: llc -mtriple=aarch64-none-linux-gnu -asm-verbose=false -global-isel=1 -global-isel-abort=1 \14; RUN: -relocation-model=pic -mattr=+pauth -o - %s | FileCheck --check-prefixes=CHECK,TRAP %s15 16; RUN: llc -mtriple=aarch64-none-linux-gnu -asm-verbose=false -global-isel=0 -fast-isel=0 \17; RUN: -relocation-model=pic -filetype=obj -mattr=+pauth -o /dev/null %s18; RUN: llc -mtriple=aarch64-none-linux-gnu -asm-verbose=false -global-isel=0 -fast-isel=1 \19; RUN: -relocation-model=pic -filetype=obj -mattr=+pauth -o /dev/null %s20; RUN: llc -mtriple=aarch64-none-linux-gnu -asm-verbose=false -global-isel=1 -global-isel-abort=1 \21; RUN: -relocation-model=pic -filetype=obj -mattr=+pauth -o /dev/null %s22 23;; Note: for FastISel, we fall back to SelectionDAG24 25declare void @consume(i32)26declare void @func()27 28define void @aliasee_func() {29 ret void30}31@alias_func = alias void (), ptr @aliasee_func32 33@aliasee_global = global i32 4234@alias_global = alias i32, ptr @aliasee_global35 36define void @foo() nounwind {37; CHECK-LABEL: foo:38entry:39 call void @consume(i32 ptrtoint (ptr @func to i32))40; CHECK: adrp x17, :got_auth:func41; CHECK-NEXT: add x17, x17, :got_auth_lo12:func42; NOTRAP-NEXT: ldr x[[TMP0:[0-9]+]], [x17]43; NOTRAP-NEXT: autia x[[TMP0]], x1744; TRAP-NEXT: ldr x16, [x17]45; TRAP-NEXT: autia x16, x1746; TRAP-NEXT: mov x17, x1647; TRAP-NEXT: xpaci x1748; TRAP-NEXT: cmp x16, x1749; TRAP-NEXT: b.eq .Lauth_success_050; TRAP-NEXT: brk #0xc47051; TRAP-NEXT: .Lauth_success_0:52; TRAP-NEXT: mov x[[TMP0:[0-9]+]], x1653 54 call void @consume(i32 ptrtoint (ptr @alias_func to i32))55; CHECK: adrp x17, :got_auth:alias_func56; CHECK-NEXT: add x17, x17, :got_auth_lo12:alias_func57; NOTRAP-NEXT: ldr x[[TMP1:[0-9]+]], [x17]58; NOTRAP-NEXT: autia x[[TMP1]], x1759; TRAP-NEXT: ldr x16, [x17]60; TRAP-NEXT: autia x16, x1761; TRAP-NEXT: mov x17, x1662; TRAP-NEXT: xpaci x1763; TRAP-NEXT: cmp x16, x1764; TRAP-NEXT: b.eq .Lauth_success_165; TRAP-NEXT: brk #0xc47066; TRAP-NEXT: .Lauth_success_1:67; TRAP-NEXT: mov x[[TMP1:[0-9]+]], x1668 69 call void @consume(i32 ptrtoint (ptr @alias_global to i32))70; CHECK: adrp x17, :got_auth:alias_global71; CHECK-NEXT: add x17, x17, :got_auth_lo12:alias_global72; NOTRAP-NEXT: ldr x[[TMP2:[0-9]+]], [x17]73; NOTRAP-NEXT: autda x[[TMP2]], x1774; TRAP-NEXT: ldr x16, [x17]75; TRAP-NEXT: autda x16, x1776; TRAP-NEXT: mov x17, x1677; TRAP-NEXT: xpacd x1778; TRAP-NEXT: cmp x16, x1779; TRAP-NEXT: b.eq .Lauth_success_280; TRAP-NEXT: brk #0xc47281; TRAP-NEXT: .Lauth_success_2:82; TRAP-NEXT: mov x[[TMP2:[0-9]+]], x1683 84 ret void85}86 87!llvm.module.flags = !{!0}88!0 = !{i32 8, !"ptrauth-elf-got", i32 1}89