diff --git a/clang/test/CodeGen/AArch64/global-inline-asm-flags.c b/clang/test/CodeGen/AArch64/global-inline-asm-flags.c new file mode 100644 index 0000000000000..0900d0cc44f68 --- /dev/null +++ b/clang/test/CodeGen/AArch64/global-inline-asm-flags.c @@ -0,0 +1,20 @@ +// RUN: %clang_cc1 -triple aarch64-linux-gnu -target-feature +pauth -flto=thin -emit-llvm -o - %s | FileCheck %s +// REQUIRES: aarch64-registered-target + +// Check that +pauth target flag is enabled for global inline assembler. + +// CHECK: module asm ".text" +// CHECK: module asm ".balign 16" +// CHECK: module asm ".globl foo" +// CHECK: module asm "pacib x30, x27" +// CHECK: module asm "retab" +// CHECK: module asm ".previous" + +asm ( + ".text" "\n" + ".balign 16" "\n" + ".globl foo\n" + "pacib x30, x27" "\n" + "retab" "\n" + ".previous" "\n" +); diff --git a/llvm/lib/Object/ModuleSymbolTable.cpp b/llvm/lib/Object/ModuleSymbolTable.cpp index 9442becdb7d33..cf7159a41e714 100644 --- a/llvm/lib/Object/ModuleSymbolTable.cpp +++ b/llvm/lib/Object/ModuleSymbolTable.cpp @@ -90,7 +90,8 @@ initializeRecordStreamer(const Module &M, if (!MAI) return; - std::unique_ptr STI(T->createMCSubtargetInfo(TT, "", "")); + std::unique_ptr STI( + T->createMCSubtargetInfo(TT, "", "+all")); if (!STI) return;