[clang] [clang][PAC][darwin] Set correct default ptrauth features for arm64e-darwin (PR #153722)
Ahmed Bougacha via cfe-commits
cfe-commits at lists.llvm.org
Fri Aug 15 15:25:58 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), \
----------------
ahmedbougacha wrote:
> So I wasn't sure how to robustly test the argument list when I'm trying to test for multiple flags? I could test based on hope (this is a reference literally no one will recognize) with something like
>
> ```
> // CHECK: flag1{{.*}}flag2{{.*}}flag3 ...
> ```
Yeah, I guess a bunch of driver test do something like that, or CHECK-SAME, or splitting the output into lines, etc.
https://github.com/llvm/llvm-project/pull/153722
More information about the cfe-commits
mailing list