diff --git a/clang/include/clang/Basic/DiagnosticDriverKinds.td b/clang/include/clang/Basic/DiagnosticDriverKinds.td index 5f6084afd293..199cec616788 100644 --- a/clang/include/clang/Basic/DiagnosticDriverKinds.td +++ b/clang/include/clang/Basic/DiagnosticDriverKinds.td @@ -532,6 +532,13 @@ def err_stack_tagging_requires_hardware_feature : Error< "'-fsanitize=memtag-stack' requires hardware support (+memtag). For Armv8 or " "Armv9, try compiling with -march=armv8a+memtag or -march=armv9a+memtag">; +def err_pauth_cpu_feature_missing : Error< + "%0 or -mbranch-protection=pauthabi is passed that require either enabling PAuth CPU feature or passing -fptrauth-soft option">; + +def warn_pauth_option_ignored : Warning< + "%0 is ignored because neither -fptrauth-calls nor -mbranch-protection=pauthabi is specified">, + InGroup; + def err_cmse_pi_are_incompatible : Error< "cmse is not compatible with %select{RWPI|ROPI}0">; diff --git a/clang/lib/Basic/Targets/AArch64.cpp b/clang/lib/Basic/Targets/AArch64.cpp index 381937641c68..aa9ebe426313 100644 --- a/clang/lib/Basic/Targets/AArch64.cpp +++ b/clang/lib/Basic/Targets/AArch64.cpp @@ -11,6 +11,7 @@ //===----------------------------------------------------------------------===// #include "AArch64.h" +#include "clang/Basic/DiagnosticDriver.h" #include "clang/Basic/LangOptions.h" #include "clang/Basic/TargetBuiltins.h" #include "clang/Basic/TargetInfo.h" @@ -197,6 +198,72 @@ AArch64TargetInfo::AArch64TargetInfo(const llvm::Triple &Triple, Opts.EABIVersion == llvm::EABI::GNU ? "\01_mcount" : "mcount"; } +void AArch64TargetInfo::validatePAuthOptions(DiagnosticsEngine &Diags, + LangOptions &Opts) const { + // AArch64TargetInfo::adjust can be called multiple times during + // compilation, so unset unsupported options to prevent printing + // multiple identical diagnostics. + auto UnsetIgnoredOptions = [&]() { + assert(!Opts.PointerAuthCalls && "Will change the behavior"); + Opts.PointerAuthInitFini = false; + Opts.FunctionPointerTypeDiscrimination = false; + Opts.PointerAuthVTPtrAddressDiscrimination = false; + Opts.PointerAuthVTPtrTypeDiscrimination = false; + Opts.PointerAuthBlockDescriptorPointers = false; + }; + auto UnsetUnsupportedOptions = [&]() { + assert(!HasPAuth && !Opts.SoftPointerAuth && "Will change the behavior"); + Opts.PointerAuthIntrinsics = false; + Opts.PointerAuthCalls = false; + Opts.PointerAuthReturns = false; + Opts.setPointerAuthObjcIsaAuthentication(PointerAuthenticationMode::None); + }; + + if (!Opts.PointerAuthCalls) { + if (Opts.PointerAuthInitFini) + Diags.Report(diag::warn_pauth_option_ignored) << "-fptrauth-init-fini"; + if (Opts.FunctionPointerTypeDiscrimination) + Diags.Report(diag::warn_pauth_option_ignored) + << "-fptrauth-function-pointer-type-discrimination"; + if (Opts.PointerAuthVTPtrAddressDiscrimination) + Diags.Report(diag::warn_pauth_option_ignored) + << "-fptrauth-vtable-pointer-address-discrimination"; + if (Opts.PointerAuthVTPtrTypeDiscrimination) + Diags.Report(diag::warn_pauth_option_ignored) + << "-fptrauth-vtable-pointer-type-discrimination"; + if (Opts.PointerAuthBlockDescriptorPointers) + Diags.Report(diag::warn_pauth_option_ignored) + << "-fptrauth-block-descriptor-pointers"; + UnsetIgnoredOptions(); + } + + if (HasPAuth || Opts.SoftPointerAuth) + return; + + // FIXME: Some ptrauth_* intrinsics can be implemented by only using + // HINT-encoded instructions, thus not requiring FEAT_PAUTH. + // At now, checking conservatively. + if (Opts.PointerAuthIntrinsics) + Diags.Report(diag::err_pauth_cpu_feature_missing) << "-fptrauth-intrinsics"; + if (Opts.PointerAuthCalls) + Diags.Report(diag::err_pauth_cpu_feature_missing) << "-fptrauth-calls"; + if (Opts.PointerAuthReturns) + Diags.Report(diag::err_pauth_cpu_feature_missing) << "-fptrauth-returns"; + if (Opts.getPointerAuthObjcIsaAuthentication() != + PointerAuthenticationMode::None) + Diags.Report(diag::err_pauth_cpu_feature_missing) + << "-fptrauth-objc-isa=..."; + + UnsetUnsupportedOptions(); + // Opts.PointerAuthCalls was unset - prevent unexpected warnings, too. + UnsetIgnoredOptions(); +} + +void AArch64TargetInfo::adjust(DiagnosticsEngine &Diags, LangOptions &Opts) { + TargetInfo::adjust(Diags, Opts); + validatePAuthOptions(Diags, Opts); +} + StringRef AArch64TargetInfo::getABI() const { return ABI; } bool AArch64TargetInfo::setABI(const std::string &Name) { diff --git a/clang/lib/Basic/Targets/AArch64.h b/clang/lib/Basic/Targets/AArch64.h index e0194a4488d2..ea97331b1dc4 100644 --- a/clang/lib/Basic/Targets/AArch64.h +++ b/clang/lib/Basic/Targets/AArch64.h @@ -91,6 +91,9 @@ class LLVM_LIBRARY_VISIBILITY AArch64TargetInfo : public TargetInfo { public: AArch64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts); + void validatePAuthOptions(DiagnosticsEngine &Diags, LangOptions &Opts) const; + void adjust(DiagnosticsEngine &Diags, LangOptions &Opts) override; + StringRef getABI() const override; bool setABI(const std::string &Name) override; diff --git a/clang/test/AST/ast-dump-ptrauth-json.cpp b/clang/test/AST/ast-dump-ptrauth-json.cpp index 125cda0cff53..f029d45d07fc 100644 --- a/clang/test/AST/ast-dump-ptrauth-json.cpp +++ b/clang/test/AST/ast-dump-ptrauth-json.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple arm64-apple-ios -fptrauth-calls -fptrauth-intrinsics -std=c++11 -ast-dump=json %s | FileCheck %s +// RUN: %clang_cc1 -triple arm64-apple-ios -target-feature +pauth -fptrauth-calls -fptrauth-intrinsics -std=c++11 -ast-dump=json %s | FileCheck %s // CHECK: "name": "__builtin_ptrauth_type_discriminator", diff --git a/clang/test/CodeGen/ptrauth-authenticated-null-values.c b/clang/test/CodeGen/ptrauth-authenticated-null-values.c index b54a8cf249fe..18370d93ae9f 100644 --- a/clang/test/CodeGen/ptrauth-authenticated-null-values.c +++ b/clang/test/CodeGen/ptrauth-authenticated-null-values.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple arm64-apple-ios -fptrauth-calls -fptrauth-intrinsics -emit-llvm %s -O0 -o - | FileCheck %s +// RUN: %clang_cc1 -triple arm64-apple-ios -target-feature +pauth -fptrauth-calls -fptrauth-intrinsics -emit-llvm %s -O0 -o - | FileCheck %s typedef void *__ptrauth(2, 0, 0, "authenticates-null-values") authenticated_null; typedef void *__ptrauth(2, 1, 0, "authenticates-null-values") authenticated_null_addr_disc; diff --git a/clang/test/CodeGen/ptrauth-blocks.c b/clang/test/CodeGen/ptrauth-blocks.c index 1d80a1fae614..75602f82b55d 100644 --- a/clang/test/CodeGen/ptrauth-blocks.c +++ b/clang/test/CodeGen/ptrauth-blocks.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple arm64-apple-ios -fptrauth-calls -fptrauth-intrinsics -fblocks -emit-llvm %s -o - | FileCheck %s +// RUN: %clang_cc1 -triple arm64-apple-ios -target-feature +pauth -fptrauth-calls -fptrauth-intrinsics -fblocks -emit-llvm %s -o - | FileCheck %s void (^blockptr)(void); diff --git a/clang/test/CodeGen/ptrauth-cfstr-isa.c b/clang/test/CodeGen/ptrauth-cfstr-isa.c index af3421189972..1b58e1e32bb4 100644 --- a/clang/test/CodeGen/ptrauth-cfstr-isa.c +++ b/clang/test/CodeGen/ptrauth-cfstr-isa.c @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -cc1 -internal-isystem /Users/oliver/llvm-internal/debug/lib/clang/11.0.0/include -nostdsysteminc -fptrauth-calls -fptrauth-objc-isa-mode=sign-and-strip -triple arm64-apple-ios -emit-llvm -O2 -disable-llvm-passes -o - %s | FileCheck %s -// RUN: %clang_cc1 -cc1 -internal-isystem /Users/oliver/llvm-internal/debug/lib/clang/11.0.0/include -nostdsysteminc -fptrauth-calls -fptrauth-objc-isa-mode=sign-and-auth -triple arm64-apple-ios -emit-llvm -O2 -disable-llvm-passes -o - %s | FileCheck %s +// RUN: %clang_cc1 -cc1 -internal-isystem /Users/oliver/llvm-internal/debug/lib/clang/11.0.0/include -nostdsysteminc -fptrauth-calls -fptrauth-objc-isa-mode=sign-and-strip -triple arm64-apple-ios -target-feature +pauth -emit-llvm -O2 -disable-llvm-passes -o - %s | FileCheck %s +// RUN: %clang_cc1 -cc1 -internal-isystem /Users/oliver/llvm-internal/debug/lib/clang/11.0.0/include -nostdsysteminc -fptrauth-calls -fptrauth-objc-isa-mode=sign-and-auth -triple arm64-apple-ios -target-feature +pauth -emit-llvm -O2 -disable-llvm-passes -o - %s | FileCheck %s #define CFSTR __builtin___CFStringMakeConstantString diff --git a/clang/test/CodeGen/ptrauth-cpu-feature.cpp b/clang/test/CodeGen/ptrauth-cpu-feature.cpp new file mode 100644 index 000000000000..d461f7306e2d --- /dev/null +++ b/clang/test/CodeGen/ptrauth-cpu-feature.cpp @@ -0,0 +1,149 @@ +// REQUIRES: aarch64-registered-target + +// Test that features requiring FEAT_PAuth fail early if the requirement is not met: +// Specifying the precise target triples here to prevent accidentally enabling unexpected +// -fptrauth-* options as target defaults (would violate NO-UNEXPECTED check lines). +// +// RUN: not %clang %s -S -o - -target aarch64-linux-gnu -mcpu=cortex-a72 -mbranch-protection=pauthabi 2>&1 \ +// RUN: | FileCheck %s --check-prefixes=FAIL-INTRINSICS,FAIL-CALLS,FAIL-RETURNS,NO-UNEXPECTED +// RUN: not %clang %s -S -o - -target aarch64-linux-gnu -mcpu=cortex-a72 -fptrauth-intrinsics 2>&1 \ +// RUN: | FileCheck %s --check-prefixes=FAIL-INTRINSICS,NO-UNEXPECTED +// RUN: not %clang %s -S -o - -target aarch64-linux-gnu -mcpu=cortex-a72 -fptrauth-calls 2>&1 \ +// RUN: | FileCheck %s --check-prefixes=FAIL-CALLS,NO-UNEXPECTED +// RUN: not %clang %s -S -o - -target aarch64-linux-gnu -mcpu=cortex-a72 -fptrauth-returns 2>&1 \ +// RUN: | FileCheck %s --check-prefixes=FAIL-RETURNS,NO-UNEXPECTED +// RUN: not %clang %s -S -o - -target aarch64-linux-gnu -mcpu=cortex-a72 -fptrauth-objc-isa 2>&1 \ +// RUN: | FileCheck %s --check-prefixes=FAIL-OBJC-ISA,NO-UNEXPECTED +// +// Test that no errors and warnings are generated if FEAT_PAUTH is supported: +// RUN: %clang %s -S -o - -target aarch64 -mcpu=apple-a12 -mbranch-protection=pauthabi 2>&1 \ +// RUN: | FileCheck %s --check-prefix=PAUTH --implicit-check-not=error --implicit-check-not=warning +// RUN: %clang %s -S -o - -target aarch64 -march=armv8.3-a -mbranch-protection=pauthabi 2>&1 \ +// RUN: | FileCheck %s --check-prefix=PAUTH --implicit-check-not=error --implicit-check-not=warning +// RUN: %clang %s -S -o - -target aarch64 -march=armv9-a -mbranch-protection=pauthabi 2>&1 \ +// RUN: | FileCheck %s --check-prefix=PAUTH --implicit-check-not=error --implicit-check-not=warning +// RUN: %clang %s -S -o - -target aarch64 -march=armv8.2-a+pauth -mbranch-protection=pauthabi 2>&1 \ +// RUN: | FileCheck %s --check-prefix=PAUTH --implicit-check-not=error --implicit-check-not=warning +// +// Test a few combinations of options that should not generate warnings: +// RUN: %clang %s -S -o - -target aarch64 -march=armv8.3-a -fptrauth-returns 2>&1 \ +// RUN: | FileCheck %s --check-prefix=NO-UNEXPECTED +// RUN: %clang %s -S -o - -target aarch64 -march=armv8.3-a -fptrauth-objc-isa 2>&1 \ +// RUN: | FileCheck %s --check-prefix=NO-UNEXPECTED +// RUN: %clang %s -S -o - -target aarch64 -march=armv8.3-a -fptrauth-init-fini -fptrauth-calls 2>&1 \ +// RUN: | FileCheck %s --check-prefix=NO-UNEXPECTED +// RUN: %clang %s -S -o - -target aarch64 -march=armv8.3-a -fptrauth-init-fini -mbranch-protection=pauthabi 2>&1 \ +// RUN: | FileCheck %s --check-prefix=NO-UNEXPECTED + +// Test that the following options are still gated on -fptrauth-calls. +// If they are not, in assertion builds they would usually fail at asm printing time. +// These tests rely on -fptrauth-calls not being implicitly enabled, so +// specifying the precise target triple. +// +// RUN: %clang %s -S -o - -target aarch64-linux-gnu -mcpu=cortex-a72 -fptrauth-init-fini 2>&1 \ +// RUN: | FileCheck %s --check-prefixes=NO-PTRAUTH-CALLS,NO-UNEXPECTED -DOPTION=-fptrauth-init-fini +// RUN: %clang %s -S -o - -target aarch64-linux-gnu -mcpu=cortex-a72 -fptrauth-function-pointer-type-discrimination 2>&1 \ +// RUN: | FileCheck %s --check-prefixes=NO-PTRAUTH-CALLS,NO-UNEXPECTED -DOPTION=-fptrauth-function-pointer-type-discrimination +// RUN: %clang %s -S -o - -target aarch64-linux-gnu -mcpu=cortex-a72 -fptrauth-vtable-pointer-address-discrimination 2>&1 \ +// RUN: | FileCheck %s --check-prefixes=NO-PTRAUTH-CALLS,NO-UNEXPECTED -DOPTION=-fptrauth-vtable-pointer-address-discrimination +// RUN: %clang %s -S -o - -target aarch64-linux-gnu -mcpu=cortex-a72 -fptrauth-vtable-pointer-type-discrimination 2>&1 \ +// RUN: | FileCheck %s --check-prefixes=NO-PTRAUTH-CALLS,NO-UNEXPECTED -DOPTION=-fptrauth-vtable-pointer-type-discrimination +// RUN: %clang %s -S -o - -target aarch64-linux-gnu -mcpu=cortex-a72 -fptrauth-block-descriptor-pointers -fblocks -DBLOCKS 2>&1 \ +// RUN: | FileCheck %s --check-prefixes=NO-PTRAUTH-CALLS,NO-UNEXPECTED -DOPTION=-fptrauth-block-descriptor-pointers + +// Test that v8.2-compatible code is generated, if possible: +// +// RUN: %clang %s -S -o - -target aarch64-linux-gnu -mcpu=cortex-a72 -msign-return-address=all 2>&1 \ +// RUN: | FileCheck %s --check-prefix=COMPAT +// RUN: %clang %s -S -o - -target aarch64-linux-gnu -mcpu=cortex-a72 -mbranch-protection=pac-ret 2>&1 \ +// RUN: | FileCheck %s --check-prefix=COMPAT +// RUN: %clang %s -S -o - -target aarch64-linux-gnu -mcpu=cortex-a72 -mbranch-protection=pac-ret+b-key 2>&1 \ +// RUN: | FileCheck %s --check-prefix=COMPAT + +// arm64e has ptrauth enabled and assumes modern enough CPU by default: +// +// RUN: %clang %s -S -o - -target arm64e-apple-ios 2>&1 \ +// RUN: | FileCheck %s --check-prefix=PAUTH +// RUN: not %clang %s -S -o - -target arm64e-apple-ios -mcpu=cortex-a72 2>&1 \ +// RUN: | FileCheck %s --check-prefixes=FAIL-INTRINSICS,FAIL-CALLS,FAIL-RETURNS,FAIL-OBJC-ISA,NO-UNEXPECTED + +volatile int counter; + +void ext(void); + +// Basically check the code generated for `caller`, other functions and classes +// are provided just to check that assertion-enabled builds do not crash when +// generating code for constructors, vtable, etc. + +extern "C" int caller(void) { + ext(); + return 0; +} + +#ifdef BLOCKS +int g(int (^bptr)(int)) { + return bptr(42); +} +#endif + +class Base { +public: + virtual void f() {} + virtual ~Base() {} +}; + +class Derived : public Base { + void f() override { + counter += 1; + } +}; + +__attribute__((constructor)) void constr(void) { + counter = 42; +} + +__attribute__((destructor)) void destr(void) { + counter = 0; +} + +// Make Base and Derived usable from outside of this compilation unit +// to prevent superfluous optimization. +extern "C" void call_virtual(Base *B) { + B->f(); +} +extern "C" void *create(bool f) { + if (f) + return new Base(); + else + return new Derived(); +} + +// NO-PTRAUTH-CALLS: warning: [[OPTION]] is ignored because neither -fptrauth-calls nor -mbranch-protection=pauthabi is specified +// FAIL-INTRINSICS: error: -fptrauth-intrinsics or -mbranch-protection=pauthabi is passed that require either enabling PAuth CPU feature or passing -fptrauth-soft option +// FAIL-CALLS: error: -fptrauth-calls or -mbranch-protection=pauthabi is passed that require either enabling PAuth CPU feature or passing -fptrauth-soft option +// FAIL-RETURNS: error: -fptrauth-returns or -mbranch-protection=pauthabi is passed that require either enabling PAuth CPU feature or passing -fptrauth-soft option +// FAIL-OBJC-ISA: error: -fptrauth-objc-isa=... or -mbranch-protection=pauthabi is passed that require either enabling PAuth CPU feature or passing -fptrauth-soft option +// NO-UNEXPECTED-NOT: error: +// NO-UNEXPECTED-NOT: warning: + +// COMPAT: caller: +// COMPAT: hint {{#25|#27}} +// +// COMPAT: hint {{#29|#31}} +// COMPAT: ret +// COMPAT: -- End function + +// PAUTH: caller: +// PAUTH: paci{{[ab]}}sp +// +// PAUTH: reta{{[ab]}} +// PAUTH: -- End function + +// Just check that some assembler output is printed and -fptrauth-init-fini +// is disabled. +// +// NO-PTRAUTH-CALLS-NOT: @AUTH +// +// NO-PTRAUTH-CALLS: caller: +// +// NO-PTRAUTH-CALLS-NOT: @AUTH diff --git a/clang/test/CodeGen/ptrauth-debuginfo.c b/clang/test/CodeGen/ptrauth-debuginfo.c index 02137a1b512a..02edba352581 100644 --- a/clang/test/CodeGen/ptrauth-debuginfo.c +++ b/clang/test/CodeGen/ptrauth-debuginfo.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple arm64-apple-ios \ +// RUN: %clang_cc1 -triple arm64-apple-ios -target-feature +pauth \ // RUN: -fptrauth-calls -fptrauth-intrinsics -emit-llvm -fblocks \ // RUN: %s -debug-info-kind=limited -o - | FileCheck %s diff --git a/clang/test/CodeGen/ptrauth-function-attributes.c b/clang/test/CodeGen/ptrauth-function-attributes.c index 19a20973493d..bae90077459e 100644 --- a/clang/test/CodeGen/ptrauth-function-attributes.c +++ b/clang/test/CodeGen/ptrauth-function-attributes.c @@ -1,15 +1,15 @@ // RUN: %clang_cc1 -triple arm64-apple-ios -emit-llvm %s -o - | FileCheck %s --check-prefixes=ALL,OFF -// RUN: %clang_cc1 -triple arm64-apple-ios -fptrauth-returns -emit-llvm %s -o - | FileCheck %s --check-prefixes=ALL,RETS -// RUN: %clang_cc1 -triple arm64e-apple-ios -fptrauth-returns -emit-llvm %s -o - | FileCheck %s --check-prefixes=ALL,RETS +// RUN: %clang_cc1 -triple arm64-apple-ios -target-feature +pauth -fptrauth-returns -emit-llvm %s -o - | FileCheck %s --check-prefixes=ALL,RETS +// RUN: %clang_cc1 -triple arm64e-apple-ios -target-feature +pauth -fptrauth-returns -emit-llvm %s -o - | FileCheck %s --check-prefixes=ALL,RETS // RUN: %clang_cc1 -triple arm64e-apple-ios -emit-llvm %s -o - | FileCheck %s --check-prefixes=ALL,OFF -// RUN: %clang_cc1 -triple arm64-apple-ios -fptrauth-calls -emit-llvm %s -o - | FileCheck %s --check-prefixes=ALL,CALLS -// RUN: %clang_cc1 -triple arm64e-apple-ios -fptrauth-calls -emit-llvm %s -o - | FileCheck %s --check-prefixes=ALL,CALLS +// RUN: %clang_cc1 -triple arm64-apple-ios -target-feature +pauth -fptrauth-calls -emit-llvm %s -o - | FileCheck %s --check-prefixes=ALL,CALLS +// RUN: %clang_cc1 -triple arm64e-apple-ios -target-feature +pauth -fptrauth-calls -emit-llvm %s -o - | FileCheck %s --check-prefixes=ALL,CALLS // RUN: %clang_cc1 -triple arm64e-apple-ios -emit-llvm %s -o - | FileCheck %s --check-prefixes=ALL,OFF -// RUN: %clang_cc1 -triple arm64-apple-ios -fptrauth-auth-traps -emit-llvm %s -o - | FileCheck %s --check-prefixes=ALL,TRAPS -// RUN: %clang_cc1 -triple arm64e-apple-ios -fptrauth-auth-traps -emit-llvm %s -o - | FileCheck %s --check-prefixes=ALL,TRAPS +// RUN: %clang_cc1 -triple arm64-apple-ios -target-feature +pauth -fptrauth-auth-traps -emit-llvm %s -o - | FileCheck %s --check-prefixes=ALL,TRAPS +// RUN: %clang_cc1 -triple arm64e-apple-ios -target-feature +pauth -fptrauth-auth-traps -emit-llvm %s -o - | FileCheck %s --check-prefixes=ALL,TRAPS // RUN: %clang_cc1 -triple arm64e-apple-ios -emit-llvm %s -o - | FileCheck %s --check-prefixes=ALL,OFF // RUN: %clang_cc1 -triple arm64e-apple-ios -mbranch-target-enforce -emit-llvm %s -o - | FileCheck %s --check-prefixes=ALL,BTI diff --git a/clang/test/CodeGen/ptrauth-function-init-fail.c b/clang/test/CodeGen/ptrauth-function-init-fail.c index e310ffd2e776..4061f90e4397 100644 --- a/clang/test/CodeGen/ptrauth-function-init-fail.c +++ b/clang/test/CodeGen/ptrauth-function-init-fail.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple arm64e-apple-ios -fptrauth-calls %s -verify -emit-llvm -S -o - +// RUN: %clang_cc1 -triple arm64e-apple-ios -target-feature +pauth -fptrauth-calls %s -verify -emit-llvm -S -o - void f(void); diff --git a/clang/test/CodeGen/ptrauth-function-init.c b/clang/test/CodeGen/ptrauth-function-init.c index ca912b699453..61f17a2b3d55 100644 --- a/clang/test/CodeGen/ptrauth-function-init.c +++ b/clang/test/CodeGen/ptrauth-function-init.c @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 %s -triple arm64e-apple-ios13 -fptrauth-calls -fptrauth-intrinsics -disable-llvm-passes -emit-llvm -o- | FileCheck %s -// RUN: %clang_cc1 -xc++ %s -triple arm64e-apple-ios13 -fptrauth-calls -fptrauth-intrinsics -disable-llvm-passes -emit-llvm -o- | FileCheck %s --check-prefixes=CHECK,CXX +// RUN: %clang_cc1 %s -triple arm64e-apple-ios13 -target-feature +pauth -fptrauth-calls -fptrauth-intrinsics -disable-llvm-passes -emit-llvm -o- | FileCheck %s +// RUN: %clang_cc1 -xc++ %s -triple arm64e-apple-ios13 -target-feature +pauth -fptrauth-calls -fptrauth-intrinsics -disable-llvm-passes -emit-llvm -o- | FileCheck %s --check-prefixes=CHECK,CXX #ifdef __cplusplus extern "C" { diff --git a/clang/test/CodeGen/ptrauth-function-lvalue-cast-disc.c b/clang/test/CodeGen/ptrauth-function-lvalue-cast-disc.c index df90ab16c327..cbfae80829de 100644 --- a/clang/test/CodeGen/ptrauth-function-lvalue-cast-disc.c +++ b/clang/test/CodeGen/ptrauth-function-lvalue-cast-disc.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -triple arm64e-apple-ios13 -fptrauth-calls -fptrauth-intrinsics -emit-llvm -o- -fptrauth-function-pointer-type-discrimination | FileCheck %s +// RUN: %clang_cc1 %s -triple arm64e-apple-ios13 -target-feature +pauth -fptrauth-calls -fptrauth-intrinsics -emit-llvm -o- -fptrauth-function-pointer-type-discrimination | FileCheck %s typedef void (*fptr_t)(void); diff --git a/clang/test/CodeGen/ptrauth-function-lvalue-cast-undisc.c b/clang/test/CodeGen/ptrauth-function-lvalue-cast-undisc.c index 8678fc648b04..8c51cf6d7650 100644 --- a/clang/test/CodeGen/ptrauth-function-lvalue-cast-undisc.c +++ b/clang/test/CodeGen/ptrauth-function-lvalue-cast-undisc.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -triple arm64e-apple-ios13 -fptrauth-calls -fptrauth-intrinsics -emit-llvm -o- | FileCheck %s +// RUN: %clang_cc1 %s -triple arm64e-apple-ios13 -target-feature +pauth -fptrauth-calls -fptrauth-intrinsics -emit-llvm -o- | FileCheck %s typedef void (*fptr_t)(void); diff --git a/clang/test/CodeGen/ptrauth-function.c b/clang/test/CodeGen/ptrauth-function.c index 51e267a04276..8e53b6f4af8e 100644 --- a/clang/test/CodeGen/ptrauth-function.c +++ b/clang/test/CodeGen/ptrauth-function.c @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 %s -fptrauth-function-pointer-type-discrimination -triple arm64e-apple-ios13 -fptrauth-calls -fptrauth-intrinsics -disable-llvm-passes -emit-llvm -o- | FileCheck %s --check-prefix=CHECK --check-prefix=CHECKC -// RUN: %clang_cc1 -xc++ %s -fptrauth-function-pointer-type-discrimination -triple arm64e-apple-ios13 -fptrauth-calls -fptrauth-intrinsics -disable-llvm-passes -emit-llvm -o- | FileCheck %s --check-prefix=CHECK --check-prefix=CHECKCXX +// RUN: %clang_cc1 %s -fptrauth-function-pointer-type-discrimination -triple arm64e-apple-ios13 -target-feature +pauth -fptrauth-calls -fptrauth-intrinsics -disable-llvm-passes -emit-llvm -o- | FileCheck %s --check-prefix=CHECK --check-prefix=CHECKC +// RUN: %clang_cc1 -xc++ %s -fptrauth-function-pointer-type-discrimination -triple arm64e-apple-ios13 -target-feature +pauth -fptrauth-calls -fptrauth-intrinsics -disable-llvm-passes -emit-llvm -o- | FileCheck %s --check-prefix=CHECK --check-prefix=CHECKCXX #ifdef __cplusplus extern "C" { diff --git a/clang/test/CodeGen/ptrauth-in-c-struct.c b/clang/test/CodeGen/ptrauth-in-c-struct.c index 322a256e62f0..2bc25b87a461 100644 --- a/clang/test/CodeGen/ptrauth-in-c-struct.c +++ b/clang/test/CodeGen/ptrauth-in-c-struct.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple arm64-apple-ios -fblocks -fptrauth-calls -fptrauth-returns -fptrauth-intrinsics -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple arm64-apple-ios -target-feature +pauth -fblocks -fptrauth-calls -fptrauth-returns -fptrauth-intrinsics -emit-llvm -o - %s | FileCheck %s #define AQ1_50 __ptrauth(1,1,50) #define AQ2_30 __ptrauth(2,1,30) diff --git a/clang/test/CodeGen/ptrauth-intrinsics.c b/clang/test/CodeGen/ptrauth-intrinsics.c index f5ec2a11711c..ffa2b4f72db5 100644 --- a/clang/test/CodeGen/ptrauth-intrinsics.c +++ b/clang/test/CodeGen/ptrauth-intrinsics.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple arm64-apple-ios -fptrauth-intrinsics -emit-llvm %s -o - | FileCheck %s +// RUN: %clang_cc1 -triple arm64-apple-ios -target-feature +pauth -fptrauth-intrinsics -emit-llvm %s -o - | FileCheck %s void (*fnptr)(void); long int_discriminator; diff --git a/clang/test/CodeGen/ptrauth-isa-masking.c b/clang/test/CodeGen/ptrauth-isa-masking.c index 607ff50b381a..ce59abe066e7 100644 --- a/clang/test/CodeGen/ptrauth-isa-masking.c +++ b/clang/test/CodeGen/ptrauth-isa-masking.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -cc1 -nostdsysteminc -fptrauth-intrinsics -fptrauth-calls -fptrauth-objc-isa-mode=sign-and-auth -fptrauth-objc-isa-masking -triple arm64-apple-ios -emit-llvm -O0 -disable-llvm-passes -o - %s | FileCheck %s +// RUN: %clang_cc1 -cc1 -nostdsysteminc -fptrauth-intrinsics -fptrauth-calls -fptrauth-objc-isa-mode=sign-and-auth -fptrauth-objc-isa-masking -triple arm64-apple-ios -target-feature +pauth -emit-llvm -O0 -disable-llvm-passes -o - %s | FileCheck %s #if __has_feature(ptrauth_qualifier_authentication_mode) #define test_ptrauth(a...) __ptrauth(a) #else diff --git a/clang/test/CodeGen/ptrauth-qualifier-loadstore.c b/clang/test/CodeGen/ptrauth-qualifier-loadstore.c index 1335c05cd135..72b1db718ba9 100644 --- a/clang/test/CodeGen/ptrauth-qualifier-loadstore.c +++ b/clang/test/CodeGen/ptrauth-qualifier-loadstore.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fptrauth-function-pointer-type-discrimination -triple arm64-apple-ios -fptrauth-calls -fptrauth-intrinsics -emit-llvm %s -o - | FileCheck %s +// RUN: %clang_cc1 -fptrauth-function-pointer-type-discrimination -triple arm64-apple-ios -target-feature +pauth -fptrauth-calls -fptrauth-intrinsics -emit-llvm %s -o - | FileCheck %s #define IQ __ptrauth(1,0,50) #define AQ __ptrauth(1,1,50) diff --git a/clang/test/CodeGen/ptrauth-qualifier.c b/clang/test/CodeGen/ptrauth-qualifier.c index 5b682895306c..5b3c9b36ffb1 100644 --- a/clang/test/CodeGen/ptrauth-qualifier.c +++ b/clang/test/CodeGen/ptrauth-qualifier.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple arm64-apple-ios -fptrauth-calls -fptrauth-intrinsics -emit-llvm %s -o - | FileCheck %s +// RUN: %clang_cc1 -triple arm64-apple-ios -target-feature +pauth -fptrauth-calls -fptrauth-intrinsics -emit-llvm %s -o - | FileCheck %s #include diff --git a/clang/test/CodeGen/ptrauth-restricted-intptr-qualifier.c b/clang/test/CodeGen/ptrauth-restricted-intptr-qualifier.c index ff96d834fcd6..4f5318d04068 100644 --- a/clang/test/CodeGen/ptrauth-restricted-intptr-qualifier.c +++ b/clang/test/CodeGen/ptrauth-restricted-intptr-qualifier.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple arm64-apple-ios -fptrauth-calls -fptrauth-intrinsics -emit-llvm %s -O0 -o - | FileCheck %s +// RUN: %clang_cc1 -triple arm64-apple-ios -target-feature +pauth -fptrauth-calls -fptrauth-intrinsics -emit-llvm %s -O0 -o - | FileCheck %s #if __has_feature(ptrauth_restricted_intptr_qualifier) __INTPTR_TYPE__ __ptrauth_restricted_intptr(1, 0, 56) g1 = 0; diff --git a/clang/test/CodeGen/ptrauth-stripping.c b/clang/test/CodeGen/ptrauth-stripping.c index 5da45c7293dd..6b536785c2e0 100644 --- a/clang/test/CodeGen/ptrauth-stripping.c +++ b/clang/test/CodeGen/ptrauth-stripping.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple arm64-apple-ios -fptrauth-calls -fptrauth-intrinsics -emit-llvm %s -o - | FileCheck %s +// RUN: %clang_cc1 -triple arm64-apple-ios -target-feature +pauth -fptrauth-calls -fptrauth-intrinsics -emit-llvm %s -o - | FileCheck %s #if __has_feature(ptrauth_qualifier_authentication_mode) typedef void *NonePointer; diff --git a/clang/test/CodeGen/ptrauth-weak_import.c b/clang/test/CodeGen/ptrauth-weak_import.c index 3445ba001565..1cc690bbcb73 100644 --- a/clang/test/CodeGen/ptrauth-weak_import.c +++ b/clang/test/CodeGen/ptrauth-weak_import.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple arm64-apple-ios -fptrauth-calls -fptrauth-intrinsics -emit-llvm %s -o - | FileCheck %s +// RUN: %clang_cc1 -triple arm64-apple-ios -target-feature +pauth -fptrauth-calls -fptrauth-intrinsics -emit-llvm %s -o - | FileCheck %s extern void foo() __attribute__((weak_import)); diff --git a/clang/test/CodeGen/ptrauth.c b/clang/test/CodeGen/ptrauth.c index 091ebba7c831..f3e80fa3b996 100644 --- a/clang/test/CodeGen/ptrauth.c +++ b/clang/test/CodeGen/ptrauth.c @@ -1,6 +1,6 @@ -// RUN: %clang_cc1 -fptrauth-function-pointer-type-discrimination -triple arm64-apple-ios -fptrauth-calls -fptrauth-intrinsics -emit-llvm %s -o - | FileCheck -check-prefix=CHECK -check-prefix=NOPCH %s -// RUN: %clang_cc1 -fptrauth-function-pointer-type-discrimination -triple arm64-apple-ios -fptrauth-calls -fptrauth-intrinsics -emit-pch %s -o %t.ast -// RUN: %clang_cc1 -fptrauth-function-pointer-type-discrimination -triple arm64-apple-ios -fptrauth-calls -fptrauth-intrinsics -emit-llvm -x ast -o - %t.ast | FileCheck -check-prefix=CHECK -check-prefix=PCH %s +// RUN: %clang_cc1 -fptrauth-function-pointer-type-discrimination -triple arm64-apple-ios -target-feature +pauth -fptrauth-calls -fptrauth-intrinsics -emit-llvm %s -o - | FileCheck -check-prefix=CHECK -check-prefix=NOPCH %s +// RUN: %clang_cc1 -fptrauth-function-pointer-type-discrimination -triple arm64-apple-ios -target-feature +pauth -fptrauth-calls -fptrauth-intrinsics -emit-pch %s -o %t.ast +// RUN: %clang_cc1 -fptrauth-function-pointer-type-discrimination -triple arm64-apple-ios -target-feature +pauth -fptrauth-calls -fptrauth-intrinsics -emit-llvm -x ast -o - %t.ast | FileCheck -check-prefix=CHECK -check-prefix=PCH %s #define FNPTRKEY 0 diff --git a/clang/test/CodeGen/ptrauth_nop_cast.c b/clang/test/CodeGen/ptrauth_nop_cast.c index 7cd844688a51..83480d52c420 100644 --- a/clang/test/CodeGen/ptrauth_nop_cast.c +++ b/clang/test/CodeGen/ptrauth_nop_cast.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple arm64e-apple-ios13.0 -fptrauth-calls -fptrauth-intrinsics -O1 %s -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 -triple arm64e-apple-ios13.0 -target-feature +pauth -fptrauth-calls -fptrauth-intrinsics -O1 %s -emit-llvm -o - | FileCheck %s #include diff --git a/clang/test/CodeGen/ubsan-function.cpp b/clang/test/CodeGen/ubsan-function.cpp index 5931e833f83d..25b8b86869ab 100644 --- a/clang/test/CodeGen/ubsan-function.cpp +++ b/clang/test/CodeGen/ubsan-function.cpp @@ -1,7 +1,7 @@ // RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -o - %s -fsanitize=function -fno-sanitize-recover=all | FileCheck %s --check-prefixes=CHECK,64 // RUN: %clang_cc1 -triple aarch64-linux-gnu -emit-llvm -o - %s -fsanitize=function -fno-sanitize-recover=all | FileCheck %s --check-prefixes=CHECK,64 // RUN: %clang_cc1 -triple aarch64_be-linux-gnu -emit-llvm -o - %s -fsanitize=function -fno-sanitize-recover=all | FileCheck %s --check-prefixes=CHECK,64 -// RUN: %clang_cc1 -triple apple-macosx-arm64e -emit-llvm -o - %s -fsanitize=function -fno-sanitize-recover=all -fptrauth-calls | FileCheck %s --check-prefixes=CHECK,64,64e +// RUN: %clang_cc1 -triple apple-macosx-arm64e -target-feature +pauth -emit-llvm -o - %s -fsanitize=function -fno-sanitize-recover=all -fptrauth-calls | FileCheck %s --check-prefixes=CHECK,64,64e // RUN: %clang_cc1 -triple arm-none-eabi -emit-llvm -o - %s -fsanitize=function -fno-sanitize-recover=all | FileCheck %s --check-prefixes=CHECK,ARM,32 // CHECK: define{{.*}} void @_Z3funv() #0 !func_sanitize ![[FUNCSAN:.*]] { diff --git a/clang/test/CodeGenCXX/builtin-get-vtable-pointer.cpp b/clang/test/CodeGenCXX/builtin-get-vtable-pointer.cpp index 5bcb70d7267f..27112bc551cc 100644 --- a/clang/test/CodeGenCXX/builtin-get-vtable-pointer.cpp +++ b/clang/test/CodeGenCXX/builtin-get-vtable-pointer.cpp @@ -1,7 +1,7 @@ // RUN: %clang_cc1 %s -x c++ -std=c++11 -triple x86_64-apple-darwin10 -emit-llvm -O1 -disable-llvm-passes -no-enable-noundef-analysis -o - | FileCheck --check-prefix=CHECK-NOAUTH %s -// RUN: %clang_cc1 %s -x c++ -std=c++11 -triple arm64-apple-ios -fptrauth-calls -fptrauth-vtable-pointer-type-discrimination -emit-llvm -O1 -disable-llvm-passes -no-enable-noundef-analysis -o - | FileCheck --check-prefix=CHECK-TYPEAUTH %s -// RUN: %clang_cc1 %s -x c++ -std=c++11 -triple arm64-apple-ios -fptrauth-calls -fptrauth-vtable-pointer-address-discrimination -emit-llvm -O1 -disable-llvm-passes -no-enable-noundef-analysis -o - | FileCheck --check-prefix=CHECK-ADDRESSAUTH %s -// RUN: %clang_cc1 %s -x c++ -std=c++11 -triple arm64-apple-ios -fptrauth-calls -fptrauth-vtable-pointer-type-discrimination -fptrauth-vtable-pointer-address-discrimination -emit-llvm -O1 -disable-llvm-passes -no-enable-noundef-analysis -o - | FileCheck --check-prefix=CHECK-BOTHAUTH %s +// RUN: %clang_cc1 %s -x c++ -std=c++11 -triple arm64-apple-ios -target-feature +pauth -fptrauth-calls -fptrauth-vtable-pointer-type-discrimination -emit-llvm -O1 -disable-llvm-passes -no-enable-noundef-analysis -o - | FileCheck --check-prefix=CHECK-TYPEAUTH %s +// RUN: %clang_cc1 %s -x c++ -std=c++11 -triple arm64-apple-ios -target-feature +pauth -fptrauth-calls -fptrauth-vtable-pointer-address-discrimination -emit-llvm -O1 -disable-llvm-passes -no-enable-noundef-analysis -o - | FileCheck --check-prefix=CHECK-ADDRESSAUTH %s +// RUN: %clang_cc1 %s -x c++ -std=c++11 -triple arm64-apple-ios -target-feature +pauth -fptrauth-calls -fptrauth-vtable-pointer-type-discrimination -fptrauth-vtable-pointer-address-discrimination -emit-llvm -O1 -disable-llvm-passes -no-enable-noundef-analysis -o - | FileCheck --check-prefix=CHECK-BOTHAUTH %s // FIXME: Assume load should not require -fstrict-vtable-pointers namespace test1 { diff --git a/clang/test/CodeGenCXX/builtin_virtual_member_address.cpp b/clang/test/CodeGenCXX/builtin_virtual_member_address.cpp index e66ec96e890d..d0a74f40f4f8 100644 --- a/clang/test/CodeGenCXX/builtin_virtual_member_address.cpp +++ b/clang/test/CodeGenCXX/builtin_virtual_member_address.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple arm64e-apple-ios -fptrauth-calls -emit-llvm -no-enable-noundef-analysis -o - %s | FileCheck %s --check-prefixes CHECK,CHECK-AUTH +// RUN: %clang_cc1 -triple arm64e-apple-ios -target-feature +pauth -fptrauth-calls -emit-llvm -no-enable-noundef-analysis -o - %s | FileCheck %s --check-prefixes CHECK,CHECK-AUTH // RUN: %clang_cc1 -triple arm64-apple-ios -emit-llvm -no-enable-noundef-analysis -o - %s | FileCheck %s --check-prefixes CHECK,CHECK-NOAUTH struct Base { diff --git a/clang/test/CodeGenCXX/ptrauth-apple-kext-indirect-call-2.cpp b/clang/test/CodeGenCXX/ptrauth-apple-kext-indirect-call-2.cpp index b29a6c8b20bb..187b984af9ec 100644 --- a/clang/test/CodeGenCXX/ptrauth-apple-kext-indirect-call-2.cpp +++ b/clang/test/CodeGenCXX/ptrauth-apple-kext-indirect-call-2.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple arm64-apple-ios -fptrauth-calls -fapple-kext -fno-rtti -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple arm64-apple-ios -target-feature +pauth -fptrauth-calls -fapple-kext -fno-rtti -emit-llvm -o - %s | FileCheck %s // CHECK: @_ZTV1A = unnamed_addr constant { [4 x ptr] } { [4 x ptr] [ptr null, ptr null, ptr @_ZNK1A3abcEv.ptrauth, ptr null] } // CHECK: @_ZTV4Base = unnamed_addr constant { [4 x ptr] } { [4 x ptr] [ptr null, ptr null, ptr @_ZNK4Base3abcEv.ptrauth, ptr null] } diff --git a/clang/test/CodeGenCXX/ptrauth-apple-kext-indirect-call.cpp b/clang/test/CodeGenCXX/ptrauth-apple-kext-indirect-call.cpp index 22318a4a5724..1e9df60ed92e 100644 --- a/clang/test/CodeGenCXX/ptrauth-apple-kext-indirect-call.cpp +++ b/clang/test/CodeGenCXX/ptrauth-apple-kext-indirect-call.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple arm64-apple-ios -fptrauth-calls -fapple-kext -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple arm64-apple-ios -target-feature +pauth -fptrauth-calls -fapple-kext -emit-llvm -o - %s | FileCheck %s // CHECK: @_ZTV5TemplIiE = internal unnamed_addr constant { [5 x ptr] } { [5 x ptr] [ptr null, ptr @_ZTI5TemplIiE, ptr @_ZN5TemplIiE1fEv.ptrauth, ptr @_ZN5TemplIiE1gEv.ptrauth, ptr null] } diff --git a/clang/test/CodeGenCXX/ptrauth-apple-kext-indirect-virtual-dtor-call.cpp b/clang/test/CodeGenCXX/ptrauth-apple-kext-indirect-virtual-dtor-call.cpp index f10ed46aabdd..acd46ca4c043 100644 --- a/clang/test/CodeGenCXX/ptrauth-apple-kext-indirect-virtual-dtor-call.cpp +++ b/clang/test/CodeGenCXX/ptrauth-apple-kext-indirect-virtual-dtor-call.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple arm64-apple-ios -std=c++98 -fptrauth-calls -fapple-kext -fno-rtti -disable-O0-optnone -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple arm64-apple-ios -target-feature +pauth -std=c++98 -fptrauth-calls -fapple-kext -fno-rtti -disable-O0-optnone -emit-llvm -o - %s | FileCheck %s // CHECK: @_ZTV5TemplIiE = internal unnamed_addr constant { [7 x ptr] } { [7 x ptr] [ptr null, ptr null, ptr @_ZN5TemplIiED1Ev.ptrauth, ptr @_ZN5TemplIiED0Ev.ptrauth, ptr @_ZN5TemplIiE1fEv.ptrauth, ptr @_ZN5TemplIiE1gEv.ptrauth, ptr null] } diff --git a/clang/test/CodeGenCXX/ptrauth-authenticated-null-values.cpp b/clang/test/CodeGenCXX/ptrauth-authenticated-null-values.cpp index cfd050699763..acd711e91350 100644 --- a/clang/test/CodeGenCXX/ptrauth-authenticated-null-values.cpp +++ b/clang/test/CodeGenCXX/ptrauth-authenticated-null-values.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple arm64-apple-ios -fptrauth-calls -fptrauth-intrinsics -emit-llvm -no-enable-noundef-analysis %s -O0 -o - | FileCheck %s +// RUN: %clang_cc1 -triple arm64-apple-ios -target-feature +pauth -fptrauth-calls -fptrauth-intrinsics -emit-llvm -no-enable-noundef-analysis %s -O0 -o - | FileCheck %s // This is largely a duplicate of CodeGen/ptrauth-authenticated-null-values.c as // there are C++ specific branches in some struct init and copy implementations diff --git a/clang/test/CodeGenCXX/ptrauth-block-capture-function-byref.cpp b/clang/test/CodeGenCXX/ptrauth-block-capture-function-byref.cpp index 14c372dbcaf2..6aaa6e13a4c5 100644 --- a/clang/test/CodeGenCXX/ptrauth-block-capture-function-byref.cpp +++ b/clang/test/CodeGenCXX/ptrauth-block-capture-function-byref.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fblocks -triple arm64-apple-ios -fptrauth-calls -emit-llvm -no-enable-noundef-analysis -std=c++11 %s -o - | FileCheck %s +// RUN: %clang_cc1 -fblocks -triple arm64-apple-ios -target-feature +pauth -fptrauth-calls -emit-llvm -no-enable-noundef-analysis -std=c++11 %s -o - | FileCheck %s // CHECK: @_Z8handler2v.ptrauth = private constant { ptr, i32, i64, i64 } { ptr @_Z8handler2v, i32 0, i64 0, i64 0 }, section "llvm.ptrauth" // CHECK: @global_handler = global ptr @_Z8handler2v.ptrauth diff --git a/clang/test/CodeGenCXX/ptrauth-explicit-vtable-pointer-control.cpp b/clang/test/CodeGenCXX/ptrauth-explicit-vtable-pointer-control.cpp index 16d0ade0e8e7..d222a1f906ec 100644 --- a/clang/test/CodeGenCXX/ptrauth-explicit-vtable-pointer-control.cpp +++ b/clang/test/CodeGenCXX/ptrauth-explicit-vtable-pointer-control.cpp @@ -1,7 +1,7 @@ -// RUN: %clang_cc1 %s -x c++ -std=c++11 -triple arm64-apple-ios -fptrauth-intrinsics -fptrauth-calls -emit-llvm -O1 -disable-llvm-passes -o - | FileCheck --check-prefix=CHECK-DEFAULT-NONE %s -// RUN: %clang_cc1 %s -x c++ -std=c++11 -triple arm64-apple-ios -fptrauth-intrinsics -fptrauth-calls -fptrauth-vtable-pointer-type-discrimination -emit-llvm -O1 -disable-llvm-passes -o - | FileCheck --check-prefix=CHECK-DEFAULT-TYPE %s -// RUN: %clang_cc1 %s -x c++ -std=c++11 -triple arm64-apple-ios -fptrauth-intrinsics -fptrauth-calls -fptrauth-vtable-pointer-address-discrimination -emit-llvm -O1 -disable-llvm-passes -o - | FileCheck --check-prefix=CHECK-DEFAULT-ADDRESS %s -// RUN: %clang_cc1 %s -x c++ -std=c++11 -triple arm64-apple-ios -fptrauth-intrinsics -fptrauth-calls -fptrauth-vtable-pointer-type-discrimination -fptrauth-vtable-pointer-address-discrimination -emit-llvm -O1 -disable-llvm-passes -o - | FileCheck --check-prefix=CHECK-DEFAULT-BOTH %s +// RUN: %clang_cc1 %s -x c++ -std=c++11 -triple arm64-apple-ios -target-feature +pauth -fptrauth-intrinsics -fptrauth-calls -emit-llvm -O1 -disable-llvm-passes -o - | FileCheck --check-prefix=CHECK-DEFAULT-NONE %s +// RUN: %clang_cc1 %s -x c++ -std=c++11 -triple arm64-apple-ios -target-feature +pauth -fptrauth-intrinsics -fptrauth-calls -fptrauth-vtable-pointer-type-discrimination -emit-llvm -O1 -disable-llvm-passes -o - | FileCheck --check-prefix=CHECK-DEFAULT-TYPE %s +// RUN: %clang_cc1 %s -x c++ -std=c++11 -triple arm64-apple-ios -target-feature +pauth -fptrauth-intrinsics -fptrauth-calls -fptrauth-vtable-pointer-address-discrimination -emit-llvm -O1 -disable-llvm-passes -o - | FileCheck --check-prefix=CHECK-DEFAULT-ADDRESS %s +// RUN: %clang_cc1 %s -x c++ -std=c++11 -triple arm64-apple-ios -target-feature +pauth -fptrauth-intrinsics -fptrauth-calls -fptrauth-vtable-pointer-type-discrimination -fptrauth-vtable-pointer-address-discrimination -emit-llvm -O1 -disable-llvm-passes -o - | FileCheck --check-prefix=CHECK-DEFAULT-BOTH %s #include namespace test1 { diff --git a/clang/test/CodeGenCXX/ptrauth-member-function-pointer.cpp b/clang/test/CodeGenCXX/ptrauth-member-function-pointer.cpp index 443b2bcbb025..e8815e98e139 100644 --- a/clang/test/CodeGenCXX/ptrauth-member-function-pointer.cpp +++ b/clang/test/CodeGenCXX/ptrauth-member-function-pointer.cpp @@ -1,8 +1,8 @@ -// RUN: %clang_cc1 -triple arm64-apple-ios -fptrauth-calls -fptrauth-intrinsics -emit-llvm -std=c++11 -O1 -disable-llvm-passes -o - %s | FileCheck -check-prefixes=CHECK,NODEBUG %s -// RUN: %clang_cc1 -triple arm64-apple-ios -fptrauth-calls -fptrauth-intrinsics -emit-llvm -std=c++11 -O1 -disable-llvm-passes -debug-info-kind=limited -o - %s | FileCheck -check-prefixes=CHECK %s -// RUN: %clang_cc1 -triple arm64-apple-ios -fptrauth-calls -fptrauth-intrinsics -emit-llvm -std=c++11 -O1 -disable-llvm-passes -stack-protector 1 -o - %s | FileCheck %s -check-prefix=STACK-PROT -// RUN: %clang_cc1 -triple arm64-apple-ios -fptrauth-calls -fptrauth-intrinsics -emit-llvm -std=c++11 -O1 -disable-llvm-passes -stack-protector 2 -o - %s | FileCheck %s -check-prefix=STACK-PROT -// RUN: %clang_cc1 -triple arm64-apple-ios -fptrauth-calls -fptrauth-intrinsics -emit-llvm -std=c++11 -O1 -disable-llvm-passes -stack-protector 3 -o - %s | FileCheck %s -check-prefix=STACK-PROT +// RUN: %clang_cc1 -triple arm64-apple-ios -target-feature +pauth -fptrauth-calls -fptrauth-intrinsics -emit-llvm -std=c++11 -O1 -disable-llvm-passes -o - %s | FileCheck -check-prefixes=CHECK,NODEBUG %s +// RUN: %clang_cc1 -triple arm64-apple-ios -target-feature +pauth -fptrauth-calls -fptrauth-intrinsics -emit-llvm -std=c++11 -O1 -disable-llvm-passes -debug-info-kind=limited -o - %s | FileCheck -check-prefixes=CHECK %s +// RUN: %clang_cc1 -triple arm64-apple-ios -target-feature +pauth -fptrauth-calls -fptrauth-intrinsics -emit-llvm -std=c++11 -O1 -disable-llvm-passes -stack-protector 1 -o - %s | FileCheck %s -check-prefix=STACK-PROT +// RUN: %clang_cc1 -triple arm64-apple-ios -target-feature +pauth -fptrauth-calls -fptrauth-intrinsics -emit-llvm -std=c++11 -O1 -disable-llvm-passes -stack-protector 2 -o - %s | FileCheck %s -check-prefix=STACK-PROT +// RUN: %clang_cc1 -triple arm64-apple-ios -target-feature +pauth -fptrauth-calls -fptrauth-intrinsics -emit-llvm -std=c++11 -O1 -disable-llvm-passes -stack-protector 3 -o - %s | FileCheck %s -check-prefix=STACK-PROT // CHECK: %[[STRUCT_CLASS0:.*]] = type { { i64, i64 } } diff --git a/clang/test/CodeGenCXX/ptrauth-qualifier-struct.cpp b/clang/test/CodeGenCXX/ptrauth-qualifier-struct.cpp index d38289cd7cef..5a75518d3047 100644 --- a/clang/test/CodeGenCXX/ptrauth-qualifier-struct.cpp +++ b/clang/test/CodeGenCXX/ptrauth-qualifier-struct.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple arm64-apple-ios -fptrauth-calls -fptrauth-intrinsics -std=c++11 -emit-llvm %s -o - | FileCheck %s +// RUN: %clang_cc1 -triple arm64-apple-ios -target-feature +pauth -fptrauth-calls -fptrauth-intrinsics -std=c++11 -emit-llvm %s -o - | FileCheck %s #define AQ __ptrauth(1,1,50) #define IQ __ptrauth(1,0,50) diff --git a/clang/test/CodeGenCXX/ptrauth-rtti-layout.cpp b/clang/test/CodeGenCXX/ptrauth-rtti-layout.cpp index 6b1a667e6f80..b35f3ff7ae44 100644 --- a/clang/test/CodeGenCXX/ptrauth-rtti-layout.cpp +++ b/clang/test/CodeGenCXX/ptrauth-rtti-layout.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -I%S -triple=arm64-apple-ios -fptrauth-calls -std=c++11 -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 %s -I%S -triple=arm64-apple-ios -target-feature +pauth -fptrauth-calls -std=c++11 -emit-llvm -o - | FileCheck %s #include struct A { int a; }; diff --git a/clang/test/CodeGenCXX/ptrauth-static-destructors.cpp b/clang/test/CodeGenCXX/ptrauth-static-destructors.cpp index 577d28b7a8f7..d729c6c7889c 100644 --- a/clang/test/CodeGenCXX/ptrauth-static-destructors.cpp +++ b/clang/test/CodeGenCXX/ptrauth-static-destructors.cpp @@ -1,8 +1,8 @@ // RUN: %clang_cc1 -fptrauth-function-pointer-type-discrimination -triple arm64-apple-ios -fptrauth-calls -emit-llvm -std=c++11 %s -o - \ -// RUN: | FileCheck %s --check-prefix=CXAATEXIT +// RUN: -target-feature +pauth | FileCheck %s --check-prefix=CXAATEXIT // RUN: %clang_cc1 -fptrauth-function-pointer-type-discrimination -triple arm64-apple-ios -fptrauth-calls -emit-llvm -std=c++11 %s -o - \ -// RUN: -fno-use-cxa-atexit \ +// RUN: -target-feature +pauth -fno-use-cxa-atexit \ // RUN: | FileCheck %s --check-prefix=ATEXIT class Foo { diff --git a/clang/test/CodeGenCXX/ptrauth-struct-attr.cpp b/clang/test/CodeGenCXX/ptrauth-struct-attr.cpp index 620eb4927339..01e5d946e9df 100644 --- a/clang/test/CodeGenCXX/ptrauth-struct-attr.cpp +++ b/clang/test/CodeGenCXX/ptrauth-struct-attr.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple arm64-apple-ios -fptrauth-calls -fptrauth-returns -fptrauth-intrinsics -emit-llvm -std=c++17 -O1 -disable-llvm-passes -no-enable-noundef-analysis -fexceptions -fcxx-exceptions -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple arm64-apple-ios -target-feature +pauth -fptrauth-calls -fptrauth-returns -fptrauth-intrinsics -emit-llvm -std=c++17 -O1 -disable-llvm-passes -no-enable-noundef-analysis -fexceptions -fcxx-exceptions -o - %s | FileCheck %s // CHECK: %[[STRUCT_S0:.*]] = type { i32, i32, [4 x i32] } // CHECK: %[[STRUCT_S5:.*]] = type { %[[STRUCT_S2:.*]] } diff --git a/clang/test/CodeGenCXX/ptrauth-throw.cpp b/clang/test/CodeGenCXX/ptrauth-throw.cpp index 6ee17a84c0e0..43a99a29a26f 100644 --- a/clang/test/CodeGenCXX/ptrauth-throw.cpp +++ b/clang/test/CodeGenCXX/ptrauth-throw.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fptrauth-function-pointer-type-discrimination -triple arm64-apple-ios -fptrauth-calls -fcxx-exceptions -emit-llvm -no-enable-noundef-analysis %s -o - | FileCheck %s +// RUN: %clang_cc1 -fptrauth-function-pointer-type-discrimination -triple arm64-apple-ios -target-feature +pauth -fptrauth-calls -fcxx-exceptions -emit-llvm -no-enable-noundef-analysis %s -o - | FileCheck %s class Foo { public: diff --git a/clang/test/CodeGenCXX/ptrauth-thunks.cpp b/clang/test/CodeGenCXX/ptrauth-thunks.cpp index 1e8e7baff38c..1537cfe11b0e 100644 --- a/clang/test/CodeGenCXX/ptrauth-thunks.cpp +++ b/clang/test/CodeGenCXX/ptrauth-thunks.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple arm64-apple-ios -fptrauth-calls -emit-llvm -std=c++11 %s -o - | FileCheck %s +// RUN: %clang_cc1 -triple arm64-apple-ios -target-feature +pauth -fptrauth-calls -emit-llvm -std=c++11 %s -o - | FileCheck %s namespace Test1 { struct B1 { diff --git a/clang/test/CodeGenCXX/ptrauth-virtual-function.cpp b/clang/test/CodeGenCXX/ptrauth-virtual-function.cpp index af84465a9ed6..585f6d07f6a4 100644 --- a/clang/test/CodeGenCXX/ptrauth-virtual-function.cpp +++ b/clang/test/CodeGenCXX/ptrauth-virtual-function.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple arm64-apple-ios -fptrauth-calls -emit-llvm -std=c++11 %s -o - | FileCheck %s +// RUN: %clang_cc1 -triple arm64-apple-ios -target-feature +pauth -fptrauth-calls -emit-llvm -std=c++11 %s -o - | FileCheck %s // Check virtual function pointers in vtables are signed and their relocation // structures are emitted. diff --git a/clang/test/CodeGenCXX/ptrauth-vtable-virtual-inheritance-thunk.cpp b/clang/test/CodeGenCXX/ptrauth-vtable-virtual-inheritance-thunk.cpp index a658f0966e64..7e21e9f98bb0 100644 --- a/clang/test/CodeGenCXX/ptrauth-vtable-virtual-inheritance-thunk.cpp +++ b/clang/test/CodeGenCXX/ptrauth-vtable-virtual-inheritance-thunk.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -x c++ -std=c++11 -triple arm64-apple-ios -fptrauth-intrinsics -fptrauth-calls -fptrauth-vtable-pointer-type-discrimination -emit-llvm -O0 -disable-llvm-passes -o - | FileCheck --check-prefix=CHECK %s +// RUN: %clang_cc1 %s -x c++ -std=c++11 -triple arm64-apple-ios -target-feature +pauth -fptrauth-intrinsics -fptrauth-calls -fptrauth-vtable-pointer-type-discrimination -emit-llvm -O0 -disable-llvm-passes -o - | FileCheck --check-prefix=CHECK %s // The actual vtable construction // CHECK: @_ZTV1C = unnamed_addr constant { [5 x ptr], [11 x ptr] } { [5 x ptr] [ptr inttoptr (i64 8 to ptr), ptr null, ptr @_ZTI1C, ptr @_ZN1CD1Ev.ptrauth, ptr @_ZN1CD0Ev.ptrauth], [11 x ptr] [ptr inttoptr (i64 -8 to ptr), ptr null, ptr null, ptr null, ptr inttoptr (i64 -8 to ptr), ptr @_ZTI1C, ptr @_ZN1A1fEv.ptrauth.2, ptr @_ZN1A1gEv.ptrauth.3, ptr @_ZN1A1hEz.ptrauth.4, ptr @_ZTv0_n48_N1CD1Ev.ptrauth, ptr @_ZTv0_n48_N1CD0Ev.ptrauth] }, align 8 diff --git a/clang/test/CodeGenCXX/ptrauth.cpp b/clang/test/CodeGenCXX/ptrauth.cpp index b0bb84290f70..db632f8a38b9 100644 --- a/clang/test/CodeGenCXX/ptrauth.cpp +++ b/clang/test/CodeGenCXX/ptrauth.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple arm64-apple-ios -fptrauth-calls -fptrauth-returns -fptrauth-intrinsics -emit-llvm -std=c++11 -fexceptions -fcxx-exceptions -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple arm64-apple-ios -target-feature +pauth -fptrauth-calls -fptrauth-returns -fptrauth-intrinsics -emit-llvm -std=c++11 -fexceptions -fcxx-exceptions -o - %s | FileCheck %s // CHECK: @_Z1fv.ptrauth = private constant { ptr, i32, i64, i64 } { ptr @_Z1fv, i32 0, i64 0, i64 0 }, diff --git a/clang/test/CodeGenCXX/ubsan-vtable-checks.cpp b/clang/test/CodeGenCXX/ubsan-vtable-checks.cpp index bb52b9d23f46..70f0d1ef0fe0 100644 --- a/clang/test/CodeGenCXX/ubsan-vtable-checks.cpp +++ b/clang/test/CodeGenCXX/ubsan-vtable-checks.cpp @@ -2,7 +2,7 @@ // RUN: %clang_cc1 -std=c++11 -triple x86_64-windows -emit-llvm -fsanitize=null %s -o - | FileCheck %s --check-prefix=CHECK-NULL --check-prefix=MSABI // RUN: %clang_cc1 -std=c++11 -triple x86_64-unknown-linux -emit-llvm -fsanitize=null,vptr %s -o - | FileCheck %s --check-prefix=CHECK-VPTR --check-prefix=ITANIUM // RUN: %clang_cc1 -std=c++11 -triple x86_64-windows -emit-llvm -fsanitize=null,vptr %s -o - | FileCheck %s --check-prefix=CHECK-VPTR --check-prefix=MSABI --check-prefix=CHECK-VPTR-MS -// RUN: %clang_cc1 -std=c++11 -triple arm64e-ios-13 -emit-llvm -fptrauth-intrinsics -fptrauth-calls -fptrauth-vtable-pointer-type-discrimination -fptrauth-vtable-pointer-address-discrimination -fsanitize=null,vptr %s -o - | FileCheck %s --check-prefix=CHECK-VPTR --check-prefix=ITANIUM --check-prefix=CHECK-PTRAUTH +// RUN: %clang_cc1 -std=c++11 -triple arm64e-ios-13 -target-feature +pauth -emit-llvm -fptrauth-intrinsics -fptrauth-calls -fptrauth-vtable-pointer-type-discrimination -fptrauth-vtable-pointer-address-discrimination -fsanitize=null,vptr %s -o - | FileCheck %s --check-prefix=CHECK-VPTR --check-prefix=ITANIUM --check-prefix=CHECK-PTRAUTH struct T { virtual ~T() {} virtual int v() { return 1; } diff --git a/clang/test/CodeGenObjC/ptrauth-attr-exception.m b/clang/test/CodeGenObjC/ptrauth-attr-exception.m index 6932600a4d3f..088a4a612d0e 100644 --- a/clang/test/CodeGenObjC/ptrauth-attr-exception.m +++ b/clang/test/CodeGenObjC/ptrauth-attr-exception.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple arm64-apple-ios -fptrauth-calls -emit-llvm -fexceptions -fobjc-exceptions -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple arm64-apple-ios -target-feature +pauth -fptrauth-calls -emit-llvm -fexceptions -fobjc-exceptions -o - %s | FileCheck %s __attribute__((objc_root_class)) @interface Root { diff --git a/clang/test/CodeGenObjC/ptrauth-block-descriptor-pointer.m b/clang/test/CodeGenObjC/ptrauth-block-descriptor-pointer.m index 5566ebdc928f..a583421c48ad 100644 --- a/clang/test/CodeGenObjC/ptrauth-block-descriptor-pointer.m +++ b/clang/test/CodeGenObjC/ptrauth-block-descriptor-pointer.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fobjc-arc -fblocks -fptrauth-calls -fptrauth-block-descriptor-pointers -triple arm64e-apple-ios -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -fobjc-arc -fblocks -fptrauth-calls -fptrauth-block-descriptor-pointers -triple arm64e-apple-ios -target-feature +pauth -emit-llvm -o - %s | FileCheck %s void a() { // Test out a global block. diff --git a/clang/test/CodeGenObjC/ptrauth-blocks.m b/clang/test/CodeGenObjC/ptrauth-blocks.m index db9f038ac7d6..d109d5a4f8f6 100644 --- a/clang/test/CodeGenObjC/ptrauth-blocks.m +++ b/clang/test/CodeGenObjC/ptrauth-blocks.m @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -fptrauth-calls -fptrauth-objc-isa-mode=sign-and-strip -fobjc-arc -fblocks -fobjc-runtime=ios-7 -triple arm64-apple-ios -emit-llvm %s -o - | FileCheck %s -// RUN: %clang_cc1 -fptrauth-calls -fptrauth-objc-isa-mode=sign-and-auth -fobjc-arc -fblocks -fobjc-runtime=ios-7 -triple arm64-apple-ios -emit-llvm %s -o - | FileCheck %s +// RUN: %clang_cc1 -fptrauth-calls -fptrauth-objc-isa-mode=sign-and-strip -fobjc-arc -fblocks -fobjc-runtime=ios-7 -triple arm64-apple-ios -target-feature +pauth -emit-llvm %s -o - | FileCheck %s +// RUN: %clang_cc1 -fptrauth-calls -fptrauth-objc-isa-mode=sign-and-auth -fobjc-arc -fblocks -fobjc-runtime=ios-7 -triple arm64-apple-ios -target-feature +pauth -emit-llvm %s -o - | FileCheck %s void (^blockptr)(void); // CHECK: @_NSConcreteGlobalBlock.ptrauth = private constant { ptr, i32, i64, i64 } { ptr @_NSConcreteGlobalBlock, i32 2, i64 ptrtoint (ptr [[GLOBAL_BLOCK_1:@.*]] to i64), i64 27361 }, section "llvm.ptrauth", align 8 diff --git a/clang/test/CodeGenObjC/ptrauth-class.m b/clang/test/CodeGenObjC/ptrauth-class.m index db57b08a07cf..785aa27f23d8 100644 --- a/clang/test/CodeGenObjC/ptrauth-class.m +++ b/clang/test/CodeGenObjC/ptrauth-class.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -Wno-everything -fblocks -fptrauth-intrinsics -triple arm64-apple-ios -fobjc-runtime=ios-12.2 -emit-llvm -no-enable-noundef-analysis -fobjc-arc -O2 -disable-llvm-passes -o - %s | FileCheck %s +// RUN: %clang_cc1 -Wno-everything -fblocks -fptrauth-intrinsics -triple arm64-apple-ios -target-feature +pauth -fobjc-runtime=ios-12.2 -emit-llvm -no-enable-noundef-analysis -fobjc-arc -O2 -disable-llvm-passes -o - %s | FileCheck %s #if __has_feature(ptrauth_objc_signable_class) struct TestStruct { diff --git a/clang/test/CodeGenObjC/ptrauth-isa-auth-mode.m b/clang/test/CodeGenObjC/ptrauth-isa-auth-mode.m index 60a2bbfdb91c..01eebed34355 100644 --- a/clang/test/CodeGenObjC/ptrauth-isa-auth-mode.m +++ b/clang/test/CodeGenObjC/ptrauth-isa-auth-mode.m @@ -1,7 +1,7 @@ -// RUN: %clang_cc1 -I %S/Inputs -Wno-objc-root-class -fptrauth-intrinsics -fptrauth-calls -triple arm64-apple-ios -fobjc-runtime=ios-12.2 -emit-llvm -fblocks -fobjc-arc -fobjc-runtime-has-weak -O2 -disable-llvm-passes -o - %s -fptrauth-objc-isa-mode=strip | FileCheck --check-prefix=CHECK-STRIP %s -// RUN: %clang_cc1 -I %S/Inputs -Wno-objc-root-class -fptrauth-intrinsics -fptrauth-calls -triple arm64-apple-ios -fobjc-runtime=ios-12.2 -emit-llvm -fblocks -fobjc-arc -fobjc-runtime-has-weak -O2 -disable-llvm-passes -o - %s -fptrauth-objc-isa-mode=sign-and-strip | FileCheck --check-prefix=CHECK-SIGN-AND-STRIP %s -// RUN: %clang_cc1 -I %S/Inputs -Wno-objc-root-class -fptrauth-intrinsics -fptrauth-calls -triple arm64-apple-ios -fobjc-runtime=ios-12.2 -emit-llvm -fblocks -fobjc-arc -fobjc-runtime-has-weak -O2 -disable-llvm-passes -o - %s -fptrauth-objc-isa-mode=sign-and-auth | FileCheck --check-prefix=CHECK-SIGN-AND-AUTH %s -// RUN: %clang_cc1 -I %S/Inputs -Wno-objc-root-class -fptrauth-intrinsics -fptrauth-calls -triple arm64-apple-ios -fobjc-runtime=ios-12.2 -emit-llvm -fblocks -fobjc-arc -fobjc-runtime-has-weak -O2 -disable-llvm-passes -o - %s | FileCheck --check-prefix=CHECK-DISABLED %s +// RUN: %clang_cc1 -I %S/Inputs -Wno-objc-root-class -fptrauth-intrinsics -fptrauth-calls -triple arm64-apple-ios -target-feature +pauth -fobjc-runtime=ios-12.2 -emit-llvm -fblocks -fobjc-arc -fobjc-runtime-has-weak -O2 -disable-llvm-passes -o - %s -fptrauth-objc-isa-mode=strip | FileCheck --check-prefix=CHECK-STRIP %s +// RUN: %clang_cc1 -I %S/Inputs -Wno-objc-root-class -fptrauth-intrinsics -fptrauth-calls -triple arm64-apple-ios -target-feature +pauth -fobjc-runtime=ios-12.2 -emit-llvm -fblocks -fobjc-arc -fobjc-runtime-has-weak -O2 -disable-llvm-passes -o - %s -fptrauth-objc-isa-mode=sign-and-strip | FileCheck --check-prefix=CHECK-SIGN-AND-STRIP %s +// RUN: %clang_cc1 -I %S/Inputs -Wno-objc-root-class -fptrauth-intrinsics -fptrauth-calls -triple arm64-apple-ios -target-feature +pauth -fobjc-runtime=ios-12.2 -emit-llvm -fblocks -fobjc-arc -fobjc-runtime-has-weak -O2 -disable-llvm-passes -o - %s -fptrauth-objc-isa-mode=sign-and-auth | FileCheck --check-prefix=CHECK-SIGN-AND-AUTH %s +// RUN: %clang_cc1 -I %S/Inputs -Wno-objc-root-class -fptrauth-intrinsics -fptrauth-calls -triple arm64-apple-ios -target-feature +pauth -fobjc-runtime=ios-12.2 -emit-llvm -fblocks -fobjc-arc -fobjc-runtime-has-weak -O2 -disable-llvm-passes -o - %s | FileCheck --check-prefix=CHECK-DISABLED %s #include _Static_assert(!__has_feature(ptrauth_objc_isa_masking), "wat"); diff --git a/clang/test/CodeGenObjC/ptrauth-isa-super.m b/clang/test/CodeGenObjC/ptrauth-isa-super.m index 274a18c9abb6..ce4a2d143299 100644 --- a/clang/test/CodeGenObjC/ptrauth-isa-super.m +++ b/clang/test/CodeGenObjC/ptrauth-isa-super.m @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -I %S/Inputs -fptrauth-calls -fptrauth-objc-isa-mode=sign-and-strip -triple arm64-apple-ios -fobjc-runtime=ios-12.2 -emit-llvm -no-enable-noundef-analysis -fblocks -fobjc-arc -fobjc-runtime-has-weak -O2 -disable-llvm-passes -o - %s | FileCheck %s -// RUN: %clang_cc1 -I %S/Inputs -fptrauth-calls -fptrauth-objc-isa-mode=sign-and-auth -triple arm64-apple-ios -fobjc-runtime=ios-12.2 -emit-llvm -no-enable-noundef-analysis -fblocks -fobjc-arc -fobjc-runtime-has-weak -O2 -disable-llvm-passes -o - %s | FileCheck %s +// RUN: %clang_cc1 -I %S/Inputs -fptrauth-calls -fptrauth-objc-isa-mode=sign-and-strip -triple arm64-apple-ios -target-feature +pauth -fobjc-runtime=ios-12.2 -emit-llvm -no-enable-noundef-analysis -fblocks -fobjc-arc -fobjc-runtime-has-weak -O2 -disable-llvm-passes -o - %s | FileCheck %s +// RUN: %clang_cc1 -I %S/Inputs -fptrauth-calls -fptrauth-objc-isa-mode=sign-and-auth -triple arm64-apple-ios -target-feature +pauth -fobjc-runtime=ios-12.2 -emit-llvm -no-enable-noundef-analysis -fblocks -fobjc-arc -fobjc-runtime-has-weak -O2 -disable-llvm-passes -o - %s | FileCheck %s #include "literal-support.h" diff --git a/clang/test/CodeGenObjC/ptrauth-method-list-pointer.m b/clang/test/CodeGenObjC/ptrauth-method-list-pointer.m index 83bf04359ad0..747c3deee544 100644 --- a/clang/test/CodeGenObjC/ptrauth-method-list-pointer.m +++ b/clang/test/CodeGenObjC/ptrauth-method-list-pointer.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fptrauth-calls -triple arm64e-apple-ios %s -S -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 -fptrauth-calls -triple arm64e-apple-ios -target-feature +pauth %s -S -emit-llvm -o - | FileCheck %s @implementation X -(void)meth {} diff --git a/clang/test/CodeGenObjC/ptrauth-method-list.m b/clang/test/CodeGenObjC/ptrauth-method-list.m index 8cde7f26145f..b07905b6b10d 100644 --- a/clang/test/CodeGenObjC/ptrauth-method-list.m +++ b/clang/test/CodeGenObjC/ptrauth-method-list.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fptrauth-calls -fobjc-arc -fblocks -fobjc-runtime=ios-7 -triple arm64-apple-ios -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -fptrauth-calls -fobjc-arc -fblocks -fobjc-runtime=ios-7 -triple arm64-apple-ios -target-feature +pauth -emit-llvm -o - %s | FileCheck %s // CHECK: @"\01+[C pm1].ptrauth" = private constant { ptr, i32, i64, i64 } { ptr @"\01+[C pm1]", i32 0, i64 ptrtoint (ptr getelementptr inbounds ({ i32, i32, [2 x %struct._objc_method] }, ptr @"_OBJC_$_CLASS_METHODS_C", i32 0, i32 2, i32 0, i32 2) to i64), i64 0 }, section "llvm.ptrauth", // CHECK: @"\01+[C m1].ptrauth" = private constant { ptr, i32, i64, i64 } { ptr @"\01+[C m1]", i32 0, i64 ptrtoint (ptr getelementptr inbounds ({ i32, i32, [2 x %struct._objc_method] }, ptr @"_OBJC_$_CLASS_METHODS_C", i32 0, i32 2, i32 1, i32 2) to i64), i64 0 }, section "llvm.ptrauth", diff --git a/clang/test/CodeGenObjC/ptrauth-property-backing.m b/clang/test/CodeGenObjC/ptrauth-property-backing.m index 3878ff73d471..1c0f814b2caf 100644 --- a/clang/test/CodeGenObjC/ptrauth-property-backing.m +++ b/clang/test/CodeGenObjC/ptrauth-property-backing.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple arm64-apple-ios -fptrauth-calls -emit-llvm -fexceptions -fptrauth-intrinsics -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple arm64-apple-ios -target-feature +pauth -fptrauth-calls -emit-llvm -fexceptions -fptrauth-intrinsics -o - %s | FileCheck %s typedef void (*func)(); diff --git a/clang/test/CodeGenObjC/ptrauth-struct-attr.m b/clang/test/CodeGenObjC/ptrauth-struct-attr.m index a3e5054f2387..645632ab54b7 100644 --- a/clang/test/CodeGenObjC/ptrauth-struct-attr.m +++ b/clang/test/CodeGenObjC/ptrauth-struct-attr.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple arm64-apple-ios -fptrauth-calls -fptrauth-returns -fptrauth-intrinsics -fobjc-arc -fobjc-runtime-has-weak -fblocks -emit-llvm -no-enable-noundef-analysis -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple arm64-apple-ios -target-feature +pauth -fptrauth-calls -fptrauth-returns -fptrauth-intrinsics -fobjc-arc -fobjc-runtime-has-weak -fblocks -emit-llvm -no-enable-noundef-analysis -o - %s | FileCheck %s #define ATTR0 __attribute__((ptrauth_struct(1, 100))) #define ATTR1 __attribute__((ptrauth_struct(1, 101))) diff --git a/clang/test/CodeGenObjCXX/ptrauth-property-object-reference.mm b/clang/test/CodeGenObjCXX/ptrauth-property-object-reference.mm index 19defce4bf25..5e171216cb9b 100644 --- a/clang/test/CodeGenObjCXX/ptrauth-property-object-reference.mm +++ b/clang/test/CodeGenObjCXX/ptrauth-property-object-reference.mm @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fptrauth-function-pointer-type-discrimination %s -triple arm64-apple-ios11.0 -fobjc-runtime=ios-11.0 -fptrauth-calls -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 -fptrauth-function-pointer-type-discrimination %s -triple arm64-apple-ios11.0 -target-feature +pauth -fobjc-runtime=ios-11.0 -fptrauth-calls -emit-llvm -o - | FileCheck %s extern int DEFAULT(); diff --git a/clang/test/CodeGenObjCXX/ptrauth-struct-cxx-abi.mm b/clang/test/CodeGenObjCXX/ptrauth-struct-cxx-abi.mm index e5cb71bad47c..28f8d967ff4f 100644 --- a/clang/test/CodeGenObjCXX/ptrauth-struct-cxx-abi.mm +++ b/clang/test/CodeGenObjCXX/ptrauth-struct-cxx-abi.mm @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple arm64-apple-ios11 -fptrauth-calls -fptrauth-intrinsics -std=c++11 -fobjc-arc -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple arm64-apple-ios11 -target-feature +pauth -fptrauth-calls -fptrauth-intrinsics -std=c++11 -fobjc-arc -emit-llvm -o - %s | FileCheck %s #define AQ __ptrauth(1,1,50) diff --git a/clang/test/Preprocessor/ptrauth-h-isa-authentication-config.c b/clang/test/Preprocessor/ptrauth-h-isa-authentication-config.c index 5c63a38620d9..27f221f2a8a0 100644 --- a/clang/test/Preprocessor/ptrauth-h-isa-authentication-config.c +++ b/clang/test/Preprocessor/ptrauth-h-isa-authentication-config.c @@ -1,9 +1,9 @@ -// RUN: %clang_cc1 -nostdsysteminc -fptrauth-intrinsics -fptrauth-calls -fptrauth-objc-isa-mode=strip -fptrauth-objc-isa-masking -triple arm64-apple-ios -E -O0 -disable-llvm-passes -o - %s | FileCheck --check-prefix=CHECK-STRIP %s -// RUN: %clang_cc1 -nostdsysteminc -fptrauth-intrinsics -fptrauth-calls -fptrauth-objc-isa-mode=sign-and-strip -fptrauth-objc-isa-masking -triple arm64-apple-ios -E -O0 -disable-llvm-passes -o - %s | FileCheck --check-prefix=CHECK-SIGN-AND-STRIP %s -// RUN: %clang_cc1 -nostdsysteminc -fptrauth-intrinsics -fptrauth-calls -fptrauth-objc-isa-mode=sign-and-auth -fptrauth-objc-isa-masking -triple arm64-apple-ios -E -O0 -disable-llvm-passes -o - %s | FileCheck --check-prefix=CHECK-SIGN-AND-AUTH %s -// RUN: %clang_cc1 -nostdsysteminc -fptrauth-intrinsics -fptrauth-calls -fptrauth-objc-isa-mode=strip -triple arm64-apple-ios -E -O0 -disable-llvm-passes -o - %s | FileCheck --check-prefix=CHECK-STRIP-NO-MASK %s -// RUN: %clang_cc1 -nostdsysteminc -fptrauth-intrinsics -fptrauth-calls -fptrauth-objc-isa-mode=sign-and-strip -triple arm64-apple-ios -E -O0 -disable-llvm-passes -o - %s | FileCheck --check-prefix=CHECK-SIGN-AND-STRIP-NO-MASK %s -// RUN: %clang_cc1 -nostdsysteminc -fptrauth-intrinsics -fptrauth-calls -fptrauth-objc-isa-mode=sign-and-auth -triple arm64-apple-ios -E -O0 -disable-llvm-passes -o - %s | FileCheck --check-prefix=CHECK-SIGN-AND-AUTH-NO-MASK %s +// RUN: %clang_cc1 -nostdsysteminc -fptrauth-intrinsics -fptrauth-calls -fptrauth-objc-isa-mode=strip -fptrauth-objc-isa-masking -triple arm64-apple-ios -target-feature +pauth -E -O0 -disable-llvm-passes -o - %s | FileCheck --check-prefix=CHECK-STRIP %s +// RUN: %clang_cc1 -nostdsysteminc -fptrauth-intrinsics -fptrauth-calls -fptrauth-objc-isa-mode=sign-and-strip -fptrauth-objc-isa-masking -triple arm64-apple-ios -target-feature +pauth -E -O0 -disable-llvm-passes -o - %s | FileCheck --check-prefix=CHECK-SIGN-AND-STRIP %s +// RUN: %clang_cc1 -nostdsysteminc -fptrauth-intrinsics -fptrauth-calls -fptrauth-objc-isa-mode=sign-and-auth -fptrauth-objc-isa-masking -triple arm64-apple-ios -target-feature +pauth -E -O0 -disable-llvm-passes -o - %s | FileCheck --check-prefix=CHECK-SIGN-AND-AUTH %s +// RUN: %clang_cc1 -nostdsysteminc -fptrauth-intrinsics -fptrauth-calls -fptrauth-objc-isa-mode=strip -triple arm64-apple-ios -target-feature +pauth -E -O0 -disable-llvm-passes -o - %s | FileCheck --check-prefix=CHECK-STRIP-NO-MASK %s +// RUN: %clang_cc1 -nostdsysteminc -fptrauth-intrinsics -fptrauth-calls -fptrauth-objc-isa-mode=sign-and-strip -triple arm64-apple-ios -target-feature +pauth -E -O0 -disable-llvm-passes -o - %s | FileCheck --check-prefix=CHECK-SIGN-AND-STRIP-NO-MASK %s +// RUN: %clang_cc1 -nostdsysteminc -fptrauth-intrinsics -fptrauth-calls -fptrauth-objc-isa-mode=sign-and-auth -triple arm64-apple-ios -target-feature +pauth -E -O0 -disable-llvm-passes -o - %s | FileCheck --check-prefix=CHECK-SIGN-AND-AUTH-NO-MASK %s #include #define _TO_STRING(x) #x diff --git a/clang/test/Preprocessor/ptrauth_feature.c b/clang/test/Preprocessor/ptrauth_feature.c index e0ad95730fa8..b8e1416864b0 100644 --- a/clang/test/Preprocessor/ptrauth_feature.c +++ b/clang/test/Preprocessor/ptrauth_feature.c @@ -1,12 +1,12 @@ // RUN: %clang_cc1 %s -E -triple=arm64-- | FileCheck %s --check-prefixes=NOCALLS,NOINTRIN,NORETS,NOQUAL -// RUN: %clang_cc1 %s -E -triple=arm64-- -fptrauth-calls | FileCheck %s --check-prefixes=CALLS,NOINTRIN,NORETS,NOQUAL,NOFUNC -// RUN: %clang_cc1 %s -E -triple=arm64-- -fptrauth-returns | FileCheck %s --check-prefixes=NOCALLS,NOINTRIN,RETS,NOQUAL,NOFUNC -// RUN: %clang_cc1 %s -E -triple=arm64-- -fptrauth-intrinsics | FileCheck %s --check-prefixes=NOCALLS,INTRIN,NORETS,QUAL,NOFUNC -// RUN: %clang_cc1 %s -E -triple=arm64e-apple-ios6.0 -fptrauth-intrinsics -fptrauth-function-pointer-type-discrimination | FileCheck %s --check-prefixes=NOCALLS,INTRIN,NORETS,QUAL,FUNC -// RUN: %clang -E %s --target=aarch64-elf -mbranch-protection=pauthabi | FileCheck %s --check-prefixes=INITFINI,VPTR_ADDR_DISCR,VPTR_TYPE_DISCR -// RUN: %clang -E %s --target=aarch64-elf -mbranch-protection=pauthabi -fno-ptrauth-init-fini | FileCheck %s --check-prefixes=NOINITFINI -// RUN: %clang -E %s --target=aarch64-elf -mbranch-protection=pauthabi -fno-ptrauth-vtable-pointer-address-discrimination | FileCheck %s --check-prefixes=NOVPTR_ADDR_DISCR -// RUN: %clang -E %s --target=aarch64-elf -mbranch-protection=pauthabi -fno-ptrauth-vtable-pointer-type-discrimination | FileCheck %s --check-prefixes=NOVPTR_TYPE_DISCR +// RUN: %clang_cc1 %s -E -triple=arm64-- -target-feature +pauth -fptrauth-calls | FileCheck %s --check-prefixes=CALLS,NOINTRIN,NORETS,NOQUAL,NOFUNC +// RUN: %clang_cc1 %s -E -triple=arm64-- -target-feature +pauth -fptrauth-returns | FileCheck %s --check-prefixes=NOCALLS,NOINTRIN,RETS,NOQUAL,NOFUNC +// RUN: %clang_cc1 %s -E -triple=arm64-- -target-feature +pauth -fptrauth-intrinsics | FileCheck %s --check-prefixes=NOCALLS,INTRIN,NORETS,QUAL,NOFUNC +// RUN: %clang_cc1 %s -E -triple=arm64e-apple-ios6.0 -target-feature +pauth -fptrauth-intrinsics -fptrauth-function-pointer-type-discrimination -fptrauth-calls | FileCheck %s --check-prefixes=CALLS,INTRIN,NORETS,QUAL,FUNC +// RUN: %clang -E %s --target=aarch64-elf -mcpu=apple-a12 -mbranch-protection=pauthabi | FileCheck %s --check-prefixes=INITFINI,VPTR_ADDR_DISCR,VPTR_TYPE_DISCR +// RUN: %clang -E %s --target=aarch64-elf -mcpu=apple-a12 -mbranch-protection=pauthabi -fno-ptrauth-init-fini | FileCheck %s --check-prefixes=NOINITFINI +// RUN: %clang -E %s --target=aarch64-elf -mcpu=apple-a12 -mbranch-protection=pauthabi -fno-ptrauth-vtable-pointer-address-discrimination | FileCheck %s --check-prefixes=NOVPTR_ADDR_DISCR +// RUN: %clang -E %s --target=aarch64-elf -mcpu=apple-a12 -mbranch-protection=pauthabi -fno-ptrauth-vtable-pointer-type-discrimination | FileCheck %s --check-prefixes=NOVPTR_TYPE_DISCR #if __has_feature(ptrauth_calls) // CALLS: has_ptrauth_calls diff --git a/clang/test/Preprocessor/ptrauth_objc_isa_feature.c b/clang/test/Preprocessor/ptrauth_objc_isa_feature.c index 8e5de43013bc..36b089fc6cd2 100644 --- a/clang/test/Preprocessor/ptrauth_objc_isa_feature.c +++ b/clang/test/Preprocessor/ptrauth_objc_isa_feature.c @@ -1,6 +1,6 @@ -// RUN: %clang_cc1 %s -E -triple=arm64-- -fptrauth-calls -fptrauth-objc-isa-mode=sign-and-strip | FileCheck %s --check-prefixes=ENABLED -// RUN: %clang_cc1 %s -E -triple=arm64-- -fptrauth-calls -fptrauth-objc-isa-mode=sign-and-auth | FileCheck %s --check-prefixes=ENABLED -// RUN: %clang_cc1 %s -E -triple=arm64-- -fptrauth-calls | FileCheck %s --check-prefixes=DISABLED +// RUN: %clang_cc1 %s -E -triple=arm64-- -target-feature +pauth -fptrauth-calls -fptrauth-objc-isa-mode=sign-and-strip | FileCheck %s --check-prefixes=ENABLED +// RUN: %clang_cc1 %s -E -triple=arm64-- -target-feature +pauth -fptrauth-calls -fptrauth-objc-isa-mode=sign-and-auth | FileCheck %s --check-prefixes=ENABLED +// RUN: %clang_cc1 %s -E -triple=arm64-- -target-feature +pauth -fptrauth-calls | FileCheck %s --check-prefixes=DISABLED #if __has_feature(ptrauth_objc_isa) // ENABLED: has_ptrauth_objc_isa diff --git a/clang/test/Sema/atomic-ops-ptrauth.c b/clang/test/Sema/atomic-ops-ptrauth.c index 65b58379c855..39db68be94d1 100644 --- a/clang/test/Sema/atomic-ops-ptrauth.c +++ b/clang/test/Sema/atomic-ops-ptrauth.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple arm64-apple-ios -fsyntax-only -verify -fptrauth-intrinsics %s +// RUN: %clang_cc1 -triple arm64-apple-ios -target-feature +pauth -fsyntax-only -verify -fptrauth-intrinsics %s #include diff --git a/clang/test/Sema/ptrauth-authenticated-null.c b/clang/test/Sema/ptrauth-authenticated-null.c index e8ef8af734ef..9967e4fc85f7 100644 --- a/clang/test/Sema/ptrauth-authenticated-null.c +++ b/clang/test/Sema/ptrauth-authenticated-null.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple arm64-apple-ios -verify -fptrauth-intrinsics %s +// RUN: %clang_cc1 -triple arm64-apple-ios -target-feature +pauth -verify -fptrauth-intrinsics %s typedef void *__ptrauth(2, 1, 0, "authenticates-null-values") authenticated_null_ptr; typedef unsigned long long __ptrauth_restricted_intptr(2, 1, 0, "authenticates-null-values") authenticated_null_uintptr; diff --git a/clang/test/Sema/ptrauth-authenticated-null.cpp b/clang/test/Sema/ptrauth-authenticated-null.cpp index 711505a148de..abcdbf7cbd99 100644 --- a/clang/test/Sema/ptrauth-authenticated-null.cpp +++ b/clang/test/Sema/ptrauth-authenticated-null.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -x c++ -std=c++11 -triple arm64-apple-ios -verify -fptrauth-intrinsics %s +// RUN: %clang_cc1 -x c++ -std=c++11 -triple arm64-apple-ios -target-feature +pauth -verify -fptrauth-intrinsics %s typedef void *__ptrauth(2, 1, 0, "authenticates-null-values") authenticated_null_ptr; typedef unsigned long long __ptrauth_restricted_intptr(2, 1, 0, "authenticates-null-values") authenticated_null_uintptr; diff --git a/clang/test/Sema/ptrauth-intrinsics-macro.c b/clang/test/Sema/ptrauth-intrinsics-macro.c index 57755c1c365f..9db4a99cd470 100644 --- a/clang/test/Sema/ptrauth-intrinsics-macro.c +++ b/clang/test/Sema/ptrauth-intrinsics-macro.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple arm64-apple-ios -Wall -fsyntax-only -verify -fptrauth-intrinsics %s +// RUN: %clang_cc1 -triple arm64-apple-ios -target-feature +pauth -Wall -fsyntax-only -verify -fptrauth-intrinsics %s // RUN: %clang_cc1 -triple arm64-apple-ios -Wall -fsyntax-only -verify %s // expected-no-diagnostics diff --git a/clang/test/Sema/ptrauth-qualifier.c b/clang/test/Sema/ptrauth-qualifier.c index 98189b66532a..41260afce686 100644 --- a/clang/test/Sema/ptrauth-qualifier.c +++ b/clang/test/Sema/ptrauth-qualifier.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple arm64-apple-ios -fsyntax-only -verify -fptrauth-intrinsics %s +// RUN: %clang_cc1 -triple arm64-apple-ios -target-feature +pauth -fsyntax-only -verify -fptrauth-intrinsics %s #include diff --git a/clang/test/Sema/ptrauth-restricted-intptr-qualifier.c b/clang/test/Sema/ptrauth-restricted-intptr-qualifier.c index 1f0e8bdd598e..95fc91d4250a 100644 --- a/clang/test/Sema/ptrauth-restricted-intptr-qualifier.c +++ b/clang/test/Sema/ptrauth-restricted-intptr-qualifier.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple arm64-apple-ios -fsyntax-only -verify -fptrauth-intrinsics %s +// RUN: %clang_cc1 -triple arm64-apple-ios -target-feature +pauth -fsyntax-only -verify -fptrauth-intrinsics %s #if __has_feature(ptrauth_restricted_intptr_qualifier) int *__ptrauth_restricted_intptr(0) a; // expected-error@-1{{__ptrauth_restricted_intptr qualifier may only be applied to pointer sized integer types; type here is 'int *'}} diff --git a/clang/test/Sema/ptrauth.c b/clang/test/Sema/ptrauth.c index 06ce1a419369..0f7b1a0d81c8 100644 --- a/clang/test/Sema/ptrauth.c +++ b/clang/test/Sema/ptrauth.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple arm64-apple-ios -fsyntax-only -verify -fptrauth-intrinsics %s +// RUN: %clang_cc1 -triple arm64-apple-ios -target-feature +pauth -fsyntax-only -verify -fptrauth-intrinsics %s #if __has_feature(ptrauth_intrinsics) #warning Pointer authentication enabled! diff --git a/clang/test/SemaCXX/ptrauth-qualifier.cpp b/clang/test/SemaCXX/ptrauth-qualifier.cpp index 2cd9ebe356f6..9ce2c09596ff 100644 --- a/clang/test/SemaCXX/ptrauth-qualifier.cpp +++ b/clang/test/SemaCXX/ptrauth-qualifier.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple arm64-apple-ios -std=c++11 -fptrauth-calls -fptrauth-intrinsics -verify -fsyntax-only %s +// RUN: %clang_cc1 -triple arm64-apple-ios -target-feature +pauth -std=c++11 -fptrauth-calls -fptrauth-intrinsics -verify -fsyntax-only %s #define AQ __ptrauth(1,1,50) #define AQ2 __ptrauth(1,1,51) diff --git a/clang/test/SemaCXX/ptrauth-struct-attr.cpp b/clang/test/SemaCXX/ptrauth-struct-attr.cpp index c82812c2b4ee..d0c05c0ab6bd 100644 --- a/clang/test/SemaCXX/ptrauth-struct-attr.cpp +++ b/clang/test/SemaCXX/ptrauth-struct-attr.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple arm64-apple-ios -fptrauth-intrinsics -fsyntax-only -verify %s +// RUN: %clang_cc1 -triple arm64-apple-ios -target-feature +pauth -fptrauth-intrinsics -fsyntax-only -verify %s #include diff --git a/clang/test/SemaCXX/ptrauth.cpp b/clang/test/SemaCXX/ptrauth.cpp index 335237eb43ed..b7ad12e66ce2 100644 --- a/clang/test/SemaCXX/ptrauth.cpp +++ b/clang/test/SemaCXX/ptrauth.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple arm64-apple-ios -std=c++17 -fsyntax-only -verify -fptrauth-intrinsics -fptrauth-calls %s +// RUN: %clang_cc1 -triple arm64-apple-ios -target-feature +pauth -std=c++17 -fsyntax-only -verify -fptrauth-intrinsics -fptrauth-calls %s struct Incomplete0; // expected-note 3 {{forward declaration of 'Incomplete0'}} diff --git a/clang/test/SemaCXX/vtable_pointer_authentication_attribute.cpp b/clang/test/SemaCXX/vtable_pointer_authentication_attribute.cpp index 3a3386196fbf..b759ee7e19e0 100644 --- a/clang/test/SemaCXX/vtable_pointer_authentication_attribute.cpp +++ b/clang/test/SemaCXX/vtable_pointer_authentication_attribute.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fsyntax-only -triple arm64-apple-ios -verify -fptrauth-calls -std=c++2a %s +// RUN: %clang_cc1 -fsyntax-only -triple arm64-apple-ios -target-feature +pauth -verify -fptrauth-calls -std=c++2a %s namespace basic { diff --git a/clang/test/SemaObjC/ptrauth-pointers.m b/clang/test/SemaObjC/ptrauth-pointers.m index 0b7a2b3e1d2c..6413bfdddb65 100644 --- a/clang/test/SemaObjC/ptrauth-pointers.m +++ b/clang/test/SemaObjC/ptrauth-pointers.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fblocks -triple arm64-apple-ios -fptrauth-calls -fptrauth-intrinsics -verify %s +// RUN: %clang_cc1 -fblocks -triple arm64-apple-ios -target-feature +pauth -fptrauth-calls -fptrauth-intrinsics -verify %s #if __has_feature(ptrauth_objc_signable_class) @class TestClass; diff --git a/clang/test/SemaObjC/ptrauth-qualifier.m b/clang/test/SemaObjC/ptrauth-qualifier.m index c020f4e087a3..db30039b09bb 100644 --- a/clang/test/SemaObjC/ptrauth-qualifier.m +++ b/clang/test/SemaObjC/ptrauth-qualifier.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple arm64-apple-ios -fsyntax-only -verify -fptrauth-intrinsics %s +// RUN: %clang_cc1 -triple arm64-apple-ios -target-feature +pauth -fsyntax-only -verify -fptrauth-intrinsics %s #if __has_feature(ptrauth_qualifier) #warning __ptrauth qualifier enabled!