[llvm] [PAC][CodeGen][ELF][AArch64] Support signed GOT (PR #96164)
Daniil Kovalev via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 5 04:54:17 PDT 2024
================
@@ -0,0 +1,39 @@
+; RUN: llc -mtriple=aarch64-linux-gnu -global-isel=0 -fast-isel=0 -verify-machineinstrs \
+; RUN: -relocation-model=pic -mattr=+pauth %s -o - | FileCheck %s
+; RUN: llc -mtriple=aarch64-linux-gnu -global-isel=0 -fast-isel=1 -verify-machineinstrs \
+; RUN: -relocation-model=pic -mattr=+pauth %s -o - | FileCheck %s
+; RUN: llc -mtriple=aarch64-linux-gnu -global-isel=1 -verify-machineinstrs \
+; RUN: -relocation-model=pic -mattr=+pauth %s -o - | FileCheck %s
+
+;; Note: for FastISel, we fall back to SelectionDAG
+
+ at var = global i32 0
+
+define i32 @get_globalvar() {
+; CHECK-LABEL: get_globalvar:
+
+ %val = load i32, ptr @var
+
+; CHECK: adrp x[[GOT:[0-9]+]], :got_auth:var
+; CHECK: add x[[GOT]], x[[GOT]], :got_auth_lo12:var
+; CHECK: ldr x[[SYM:[0-9]+]], [x[[GOT]]]
+; CHECK: autda x[[SYM]], x[[GOT]]
+; CHECK: ldr w0, [x[[SYM]]]
----------------
kovdan01 wrote:
Ah, yes, they should, thanks for bringing attention to this.
The tests were initially copied from non-auth variants, and those did not have -NEXT. I'll submit a separate commit adding -NEXT where appropriate in non-auth tests.
https://github.com/llvm/llvm-project/pull/96164
More information about the llvm-commits
mailing list