Skip to content

Commit 700c00e

Browse files
committed
Minor test enhancement
1 parent 8ab629f commit 700c00e

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

clang/test/Driver/aarch64-ptrauth.c

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// NONE: "-cc1"
55
// NONE-NOT: "-fptrauth-
66

7-
//// -fptauth-* driver flags are only supported for pauthtest ABI
7+
//// -fptauth-* driver flags on Linux are only supported with pauthtest ABI.
88
// RUN: %clang -### -c --target=aarch64-linux -mabi=pauthtest \
99
// RUN: -fno-ptrauth-intrinsics -fptrauth-intrinsics \
1010
// RUN: -fno-ptrauth-calls -fptrauth-calls \
@@ -40,6 +40,7 @@
4040
// RUN: %s 2>&1 | FileCheck %s --check-prefix=ALL-LINUX
4141
// ALL-LINUX: "-cc1"{{.*}} "-faarch64-jump-table-hardening"
4242

43+
//// Some -fptrauth-* flags are supported for ARM64 Darwin.
4344
// RUN: %clang -### -c --target=arm64-darwin \
4445
// RUN: -fno-ptrauth-intrinsics -fptrauth-intrinsics \
4546
// RUN: -fno-ptrauth-calls -fptrauth-calls \
@@ -58,7 +59,7 @@
5859
// PAUTHTEST1: "-cc1"{{.*}} "-triple" "aarch64-unknown-linux-pauthtest"
5960
// PAUTHTEST1-SAME: "-fptrauth-intrinsics" "-fptrauth-calls" "-fptrauth-returns" "-fptrauth-auth-traps" "-fptrauth-vtable-pointer-address-discrimination" "-fptrauth-vtable-pointer-type-discrimination" "-fptrauth-type-info-vtable-pointer-discrimination" "-fptrauth-indirect-gotos" "-fptrauth-init-fini" "-fptrauth-init-fini-address-discrimination" "-faarch64-jump-table-hardening"
6061
// PAUTHTEST1-SAME: "-target-abi" "pauthtest"
61-
// PAUTHTEST1-NOT: "-fptrauth-function-pointer-type-discrimination"
62+
// PAUTHTEST1-NOT: "-fptrauth-function-pointer-type-discrimination"
6263

6364
// RUN: %clang -### -c --target=aarch64-linux -mabi=pauthtest -fno-ptrauth-intrinsics \
6465
// RUN: -fno-ptrauth-calls -fno-ptrauth-returns -fno-ptrauth-auth-traps \
@@ -75,19 +76,19 @@
7576

7677
//// Non-linux OS: pauthtest ABI has no effect in terms of passing ptrauth cc1 flags.
7778
//// An error about unsupported ABI will be emitted later in pipeline (see ERR3 below)
78-
// RUN: %clang -### -c --target=aarch64 -mabi=pauthtest %s 2>&1 | FileCheck %s --check-prefixes=PAUTHTEST2
79+
// RUN: %clang -### -c --target=aarch64 -mabi=pauthtest %s 2>&1 | FileCheck %s --check-prefix=PAUTHTEST2
7980

8081
// PAUTHTEST2: "-cc1"
8182
// PAUTHTEST2-SAME: "-target-abi" "pauthtest"
8283
// PAUTHTEST2-NOT: "-fptrauth-
83-
// PAUTHTEST2-NOT: "-faarch64-jump-table-hardening"
84+
// PAUTHTEST2-NOT: "-faarch64-jump-table-hardening"
8485

8586
//// Non-linux OS: pauthtest environment does not correspond to pauthtest ABI; aapcs is the default.
8687
// RUN: %clang -### -c --target=aarch64-pauthtest %s 2>&1 | FileCheck %s --check-prefix=PAUTHTEST3
8788
// PAUTHTEST3: "-cc1"
8889
// PAUTHTEST3-SAME: "-target-abi" "aapcs"
8990
// PAUTHTEST3-NOT: "-fptrauth-
90-
// PAUTHTEST3-NOT: "-faarch64-jump-table-hardening"
91+
// PAUTHTEST3-NOT: "-faarch64-jump-table-hardening"
9192

9293
//// Non-pauthtest ABI.
9394
// RUN: not %clang -### -c --target=aarch64-linux -fptrauth-intrinsics -fptrauth-calls -fptrauth-returns -fptrauth-auth-traps \
@@ -107,14 +108,16 @@
107108
// ERR1-NEXT: error: unsupported option '-fptrauth-elf-got' for target '{{.*}}'
108109

109110
//// Non-AArch64.
110-
// RUN: not %clang -### -c --target=x86_64-linux -faarch64-jump-table-hardening %s 2>&1 | FileCheck %s --check-prefixes=ERR2
111+
// RUN: not %clang -### -c --target=x86_64-linux -faarch64-jump-table-hardening %s 2>&1 | FileCheck %s --check-prefix=ERR2
111112
// ERR2: error: unsupported option '-faarch64-jump-table-hardening' for target '{{.*}}'
112113

114+
//// Only support PAuth ABI for Linux as for now.
113115
// RUN: not %clang -c --target=aarch64 -mabi=pauthtest %s 2>&1 | FileCheck %s --check-prefix=ERR3
116+
// ERR3: error: unknown target ABI 'pauthtest'
117+
114118
//// The ABI is not specified explicitly, and for non-Linux pauthtest environment does not correspond
115119
//// to pauthtest ABI (each OS target defines this behavior separately). Do not emit an error.
116-
// RUN: %clang -c --target=aarch64-pauthtest %s -o /dev/null
117-
// ERR3: error: unknown target ABI 'pauthtest'
120+
// RUN: %clang -c --target=aarch64-pauthtest %s -o /dev/null
118121

119122
//// PAuth ABI is encoded as environment part of the triple, so don't allow to explicitly set other environments.
120123
// RUN: not %clang -### -c --target=aarch64-linux-gnu -mabi=pauthtest %s 2>&1 | FileCheck %s --check-prefix=ERR4

0 commit comments

Comments
 (0)