Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error if PAuth language features are used on unsupported CPU #66

Merged
merged 1 commit into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions clang/include/clang/Basic/DiagnosticDriverKinds.td
Original file line number Diff line number Diff line change
Expand Up @@ -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<OptionIgnored>;

def err_cmse_pi_are_incompatible : Error<
"cmse is not compatible with %select{RWPI|ROPI}0">;

Expand Down
67 changes: 67 additions & 0 deletions clang/lib/Basic/Targets/AArch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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) {
Expand Down
3 changes: 3 additions & 0 deletions clang/lib/Basic/Targets/AArch64.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion clang/test/AST/ast-dump-ptrauth-json.cpp
Original file line number Diff line number Diff line change
@@ -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",

Expand Down
2 changes: 1 addition & 1 deletion clang/test/CodeGen/ptrauth-authenticated-null-values.c
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 1 addition & 1 deletion clang/test/CodeGen/ptrauth-blocks.c
Original file line number Diff line number Diff line change
@@ -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);

Expand Down
4 changes: 2 additions & 2 deletions clang/test/CodeGen/ptrauth-cfstr-isa.c
Original file line number Diff line number Diff line change
@@ -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

Expand Down
149 changes: 149 additions & 0 deletions clang/test/CodeGen/ptrauth-cpu-feature.cpp
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion clang/test/CodeGen/ptrauth-debuginfo.c
Original file line number Diff line number Diff line change
@@ -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

Expand Down
12 changes: 6 additions & 6 deletions clang/test/CodeGen/ptrauth-function-attributes.c
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion clang/test/CodeGen/ptrauth-function-init-fail.c
Original file line number Diff line number Diff line change
@@ -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);

Expand Down
4 changes: 2 additions & 2 deletions clang/test/CodeGen/ptrauth-function-init.c
Original file line number Diff line number Diff line change
@@ -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" {
Expand Down
2 changes: 1 addition & 1 deletion clang/test/CodeGen/ptrauth-function-lvalue-cast-disc.c
Original file line number Diff line number Diff line change
@@ -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);

Expand Down
2 changes: 1 addition & 1 deletion clang/test/CodeGen/ptrauth-function-lvalue-cast-undisc.c
Original file line number Diff line number Diff line change
@@ -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);

Expand Down
4 changes: 2 additions & 2 deletions clang/test/CodeGen/ptrauth-function.c
Original file line number Diff line number Diff line change
@@ -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" {
Expand Down
2 changes: 1 addition & 1 deletion clang/test/CodeGen/ptrauth-in-c-struct.c
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
Loading