[clang] [llvm] [PAC][clang] Fix ptrauth module flags behavior (PR #204226)

Anatoly Trosinenko via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 9 05:08:39 PDT 2026


================
@@ -1,8 +1,18 @@
-; RUN: llc -mtriple aarch64-linux-pauthtest -mattr +pauth -filetype=asm %s -o - | \
+; RUN: rm -rf %t && split-file %s %t && cd %t
+; RUN: cat common.ll elf-got-flag-1.ll > auth.ll
+; RUN: cat common.ll elf-got-flag-0.ll > noauth1.ll
+; RUN: cat common.ll                   > noauth2.ll
+
+; RUN: llc -mtriple aarch64-linux-pauthtest -mattr +pauth -filetype=asm auth.ll -o - | \
 ; RUN:   FileCheck %s --check-prefix=ASM
-; RUN: llc -mtriple aarch64-linux-pauthtest -mattr +pauth -filetype=obj %s -o - | \
+; RUN: llc -mtriple aarch64-linux-pauthtest -mattr +pauth -filetype=obj auth.ll -o - | \
 ; RUN:   llvm-readelf -s - | FileCheck %s --check-prefix=OBJ
 
+; RUN: llc -mtriple aarch64-linux-gnu -mattr +pauth -filetype=obj noauth1.ll -o - | \
+; RUN:   llvm-readelf -s - | FileCheck %s --check-prefix=OBJ-NOAUTH
+; RUN: llc -mtriple aarch64-linux-gnu -mattr +pauth -filetype=obj noauth2.ll -o - | \
+; RUN:   llvm-readelf -s - | FileCheck %s --check-prefix=OBJ-NOAUTH
----------------
atrosinenko wrote:

I would suggest adding corresponding `ASM-NOAUTH` checks as well: as far as I remember, there are basically two "entry points" where the module flag (tristate: 0/1/absent) is parsed into some internal boolean representation - one in machine function information and another one in the asm printer. Your `OBJ-NOAUTH` lines check the latter entry point and `ASM-NOAUTH` (which should be much shorter that the existing `ASM` checks, I guess) would check the former one.

https://github.com/llvm/llvm-project/pull/204226


More information about the cfe-commits mailing list