|
4 | 4 | // NONE: "-cc1"
|
5 | 5 | // NONE-NOT: "-fptrauth-
|
6 | 6 |
|
7 |
| -//// -fptauth-* driver flags are only supported for pauthtest ABI |
| 7 | +//// -fptauth-* driver flags on Linux are only supported with pauthtest ABI. |
8 | 8 | // RUN: %clang -### -c --target=aarch64-linux -mabi=pauthtest \
|
9 | 9 | // RUN: -fno-ptrauth-intrinsics -fptrauth-intrinsics \
|
10 | 10 | // RUN: -fno-ptrauth-calls -fptrauth-calls \
|
|
40 | 40 | // RUN: %s 2>&1 | FileCheck %s --check-prefix=ALL-LINUX
|
41 | 41 | // ALL-LINUX: "-cc1"{{.*}} "-faarch64-jump-table-hardening"
|
42 | 42 |
|
| 43 | +//// Some -fptrauth-* flags are supported for ARM64 Darwin. |
43 | 44 | // RUN: %clang -### -c --target=arm64-darwin \
|
44 | 45 | // RUN: -fno-ptrauth-intrinsics -fptrauth-intrinsics \
|
45 | 46 | // RUN: -fno-ptrauth-calls -fptrauth-calls \
|
|
58 | 59 | // PAUTHTEST1: "-cc1"{{.*}} "-triple" "aarch64-unknown-linux-pauthtest"
|
59 | 60 | // 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"
|
60 | 61 | // PAUTHTEST1-SAME: "-target-abi" "pauthtest"
|
61 |
| -// PAUTHTEST1-NOT: "-fptrauth-function-pointer-type-discrimination" |
| 62 | +// PAUTHTEST1-NOT: "-fptrauth-function-pointer-type-discrimination" |
62 | 63 |
|
63 | 64 | // RUN: %clang -### -c --target=aarch64-linux -mabi=pauthtest -fno-ptrauth-intrinsics \
|
64 | 65 | // RUN: -fno-ptrauth-calls -fno-ptrauth-returns -fno-ptrauth-auth-traps \
|
|
75 | 76 |
|
76 | 77 | //// Non-linux OS: pauthtest ABI has no effect in terms of passing ptrauth cc1 flags.
|
77 | 78 | //// 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 |
79 | 80 |
|
80 | 81 | // PAUTHTEST2: "-cc1"
|
81 | 82 | // PAUTHTEST2-SAME: "-target-abi" "pauthtest"
|
82 | 83 | // PAUTHTEST2-NOT: "-fptrauth-
|
83 |
| -// PAUTHTEST2-NOT: "-faarch64-jump-table-hardening" |
| 84 | +// PAUTHTEST2-NOT: "-faarch64-jump-table-hardening" |
84 | 85 |
|
85 | 86 | //// Non-linux OS: pauthtest environment does not correspond to pauthtest ABI; aapcs is the default.
|
86 | 87 | // RUN: %clang -### -c --target=aarch64-pauthtest %s 2>&1 | FileCheck %s --check-prefix=PAUTHTEST3
|
87 | 88 | // PAUTHTEST3: "-cc1"
|
88 | 89 | // PAUTHTEST3-SAME: "-target-abi" "aapcs"
|
89 | 90 | // PAUTHTEST3-NOT: "-fptrauth-
|
90 |
| -// PAUTHTEST3-NOT: "-faarch64-jump-table-hardening" |
| 91 | +// PAUTHTEST3-NOT: "-faarch64-jump-table-hardening" |
91 | 92 |
|
92 | 93 | //// Non-pauthtest ABI.
|
93 | 94 | // RUN: not %clang -### -c --target=aarch64-linux -fptrauth-intrinsics -fptrauth-calls -fptrauth-returns -fptrauth-auth-traps \
|
|
107 | 108 | // ERR1-NEXT: error: unsupported option '-fptrauth-elf-got' for target '{{.*}}'
|
108 | 109 |
|
109 | 110 | //// 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 |
111 | 112 | // ERR2: error: unsupported option '-faarch64-jump-table-hardening' for target '{{.*}}'
|
112 | 113 |
|
| 114 | +//// Only support PAuth ABI for Linux as for now. |
113 | 115 | // RUN: not %clang -c --target=aarch64 -mabi=pauthtest %s 2>&1 | FileCheck %s --check-prefix=ERR3
|
| 116 | +// ERR3: error: unknown target ABI 'pauthtest' |
| 117 | + |
114 | 118 | //// The ABI is not specified explicitly, and for non-Linux pauthtest environment does not correspond
|
115 | 119 | //// 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 |
118 | 121 |
|
119 | 122 | //// PAuth ABI is encoded as environment part of the triple, so don't allow to explicitly set other environments.
|
120 | 123 | // RUN: not %clang -### -c --target=aarch64-linux-gnu -mabi=pauthtest %s 2>&1 | FileCheck %s --check-prefix=ERR4
|
|
0 commit comments