[clang] [clang][PAC][darwin] Set correct default ptrauth features for arm64e-darwin (PR #153722)
Oliver Hunt via cfe-commits
cfe-commits at lists.llvm.org
Sat Aug 16 13:18:29 PDT 2025
================
@@ -0,0 +1,85 @@
+// RUN: %clang -target arm64 -DNO_DEFAULT_PTRAUTH %s -fsyntax-only -Xclang -verify=no_default_ptrauth
+// RUN: %clang -target arm64-apple-macosx -DNO_DEFAULT_PTRAUTH %s -fsyntax-only -Xclang -verify=no_default_ptrauth
+// RUN: %clang -target arm64-darwin -DNO_DEFAULT_PTRAUTH %s -fsyntax-only -Xclang -verify=no_default_ptrauth
+// RUN: %clang -target arm64-apple-darwin -DNO_DEFAULT_PTRAUTH %s -fsyntax-only -Xclang -verify=no_default_ptrauth
+// RUN: %clang -target arm64-apple-ios-macabi -DNO_DEFAULT_PTRAUTH %s -fsyntax-only -Xclang -verify=no_default_ptrauth
+// RUN: %clang -target arm64-linux-gnu -DNO_DEFAULT_PTRAUTH %s -fsyntax-only -Xclang -verify=no_default_ptrauth
+// RUN: %clang -target arm64e-linux-gnu -DNO_DEFAULT_PTRAUTH %s -fsyntax-only -Xclang -verify=no_default_ptrauth
+// RUN: %clang -target aarch64-linux-gnu -DNO_DEFAULT_PTRAUTH %s -fsyntax-only -Xclang -verify=no_default_ptrauth
+// RUN: %clang -target arm64e-apple-macosx -DDARWIN_DEFAULT_PTRAUTH %s -fsyntax-only -Xclang -verify=darwin_ptrauth_defaults
+// RUN: %clang -target arm64e-apple-ios -DDARWIN_DEFAULT_PTRAUTH %s -fsyntax-only -Xclang -verify=darwin_ptrauth_defaults
+// RUN: %clang -target arm64e-darwin -DDARWIN_DEFAULT_PTRAUTH %s -fsyntax-only -Xclang -verify=darwin_ptrauth_defaults
+// RUN: %clang -target arm64e-apple-darwin -DDARWIN_DEFAULT_PTRAUTH %s -fsyntax-only -Xclang -verify=darwin_ptrauth_defaults
+// RUN: %clang -target arm64e-apple-ios-macabi -DDARWIN_DEFAULT_PTRAUTH %s -fsyntax-only -Xclang -verify=darwin_ptrauth_defaults
+
+// A simple test case to test basic override logic
+// RUN: %clang -target arm64e-apple-macosx -DDARWIN_DEFAULT_PTRAUTH_OVERRIDE -fno-ptrauth-calls %s -fsyntax-only -Xclang -verify=darwin_ptrauth_override
+
+#define ASSERT_MODE_AND_KIND(feature, enabled, kind) \
+ _Static_assert(enabled == __has_##kind(feature), \
----------------
ojhunt wrote:
@ahmedbougacha the feature check based test was literally because I couldn't work out how to deal with the variable ordering of parameters, but having moved this down to the macho target arg generation all of the flags end up in a single sequence.
I am going to keep a feature check version of this just as a text for the default driver flags correctly propagating to the cc1 layer.
https://github.com/llvm/llvm-project/pull/153722
More information about the cfe-commits
mailing list