|
4 | 4 | // NONE: "-cc1"
|
5 | 5 | // NONE-NOT: "-fptrauth-
|
6 | 6 |
|
7 |
| -// RUN: %clang -### -c --target=aarch64 \ |
| 7 | +// RUN: %clang -### -c --target=aarch64-linux \ |
8 | 8 | // RUN: -fno-ptrauth-intrinsics -fptrauth-intrinsics \
|
9 | 9 | // RUN: -fno-ptrauth-calls -fptrauth-calls \
|
10 | 10 | // RUN: -fno-ptrauth-returns -fptrauth-returns \
|
|
17 | 17 | // RUN: -fno-ptrauth-init-fini-address-discrimination -fptrauth-init-fini-address-discrimination \
|
18 | 18 | // RUN: -fno-aarch64-jump-table-hardening -faarch64-jump-table-hardening \
|
19 | 19 | // RUN: %s 2>&1 | FileCheck %s --check-prefix=ALL
|
20 |
| -// ALL: "-cc1"{{.*}} "-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" |
| 20 | +// RUN: %clang -### -c --target=arm64-darwin \ |
| 21 | +// RUN: -fno-ptrauth-intrinsics -fptrauth-intrinsics \ |
| 22 | +// RUN: -fno-ptrauth-calls -fptrauth-calls \ |
| 23 | +// RUN: -fno-ptrauth-returns -fptrauth-returns \ |
| 24 | +// RUN: -fno-ptrauth-auth-traps -fptrauth-auth-traps \ |
| 25 | +// RUN: -fno-ptrauth-vtable-pointer-address-discrimination -fptrauth-vtable-pointer-address-discrimination \ |
| 26 | +// RUN: -fno-ptrauth-vtable-pointer-type-discrimination -fptrauth-vtable-pointer-type-discrimination \ |
| 27 | +// RUN: -fno-ptrauth-type-info-vtable-pointer-discrimination -fptrauth-type-info-vtable-pointer-discrimination \ |
| 28 | +// RUN: -fno-ptrauth-indirect-gotos -fptrauth-indirect-gotos \ |
| 29 | +// RUN: -fno-ptrauth-init-fini -fptrauth-init-fini \ |
| 30 | +// RUN: -fno-ptrauth-init-fini-address-discrimination -fptrauth-init-fini-address-discrimination \ |
| 31 | +// RUN: -fno-aarch64-jump-table-hardening -faarch64-jump-table-hardening \ |
| 32 | +// RUN: %s 2>&1 | FileCheck %s --check-prefix=ALL |
| 33 | +// ALL: "-cc1"{{.*}} "-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" |
21 | 34 |
|
22 | 35 | // RUN: %clang -### -c --target=aarch64-linux -mabi=pauthtest %s 2>&1 | FileCheck %s --check-prefix=PAUTHABI1
|
23 | 36 | // RUN: %clang -### -c --target=aarch64-linux-pauthtest %s 2>&1 | FileCheck %s --check-prefix=PAUTHABI1
|
|
40 | 53 | // RUN: -fno-aarch64-jump-table-hardening %s 2>&1 | FileCheck %s --check-prefix=PAUTHABI2
|
41 | 54 |
|
42 | 55 | //// Non-linux OS: pauthtest ABI has no effect in terms of passing ptrauth cc1 flags.
|
43 |
| -//// An error about unsupported ABI will be emitted later in pipeline (see ERR2 below) |
| 56 | +//// An error about unsupported ABI will be emitted later in pipeline (see ERR3 below) |
44 | 57 | // RUN: %clang -### -c --target=aarch64 -mabi=pauthtest %s 2>&1 | FileCheck %s --check-prefix=PAUTHABI2
|
45 | 58 |
|
46 | 59 | // PAUTHABI2: "-cc1"
|
|
55 | 68 | // PAUTHABI3-NOT: "-fptrauth-
|
56 | 69 | // PAUTHABI3-NOT: "-faarch64-jump-table-hardening"
|
57 | 70 |
|
58 |
| -// RUN: not %clang -### -c --target=x86_64 -fptrauth-intrinsics -fptrauth-calls -fptrauth-returns -fptrauth-auth-traps \ |
| 71 | +//// Non-AArch64. |
| 72 | +// RUN: not %clang -### -c --target=x86_64-linux -fptrauth-intrinsics -fptrauth-calls -fptrauth-returns -fptrauth-auth-traps \ |
| 73 | +// RUN: -fptrauth-vtable-pointer-address-discrimination -fptrauth-vtable-pointer-type-discrimination \ |
| 74 | +// RUN: -fptrauth-type-info-vtable-pointer-discrimination -fptrauth-indirect-gotos -fptrauth-init-fini \ |
| 75 | +// RUN: -fptrauth-init-fini-address-discrimination -faarch64-jump-table-hardening %s 2>&1 | FileCheck %s --check-prefixes=ERR1,ERR2 |
| 76 | +//// Non-linux and non-Darwin OS. |
| 77 | +// RUN: not %clang -### -c --target=aarch64 -fptrauth-intrinsics -fptrauth-calls -fptrauth-returns -fptrauth-auth-traps \ |
59 | 78 | // RUN: -fptrauth-vtable-pointer-address-discrimination -fptrauth-vtable-pointer-type-discrimination \
|
60 | 79 | // RUN: -fptrauth-type-info-vtable-pointer-discrimination -fptrauth-indirect-gotos -fptrauth-init-fini \
|
61 | 80 | // RUN: -fptrauth-init-fini-address-discrimination -faarch64-jump-table-hardening %s 2>&1 | FileCheck %s --check-prefix=ERR1
|
|
69 | 88 | // ERR1-NEXT: error: unsupported option '-fptrauth-indirect-gotos' for target '{{.*}}'
|
70 | 89 | // ERR1-NEXT: error: unsupported option '-fptrauth-init-fini' for target '{{.*}}'
|
71 | 90 | // ERR1-NEXT: error: unsupported option '-fptrauth-init-fini-address-discrimination' for target '{{.*}}'
|
72 |
| -// ERR1-NEXT: error: unsupported option '-faarch64-jump-table-hardening' for target '{{.*}}' |
| 91 | +// ERR2-NEXT: error: unsupported option '-faarch64-jump-table-hardening' for target '{{.*}}' |
73 | 92 |
|
74 | 93 |
|
75 |
| -// RUN: not %clang -c --target=aarch64 -mabi=pauthtest %s 2>&1 | FileCheck %s --check-prefix=ERR2 |
| 94 | +// RUN: not %clang -c --target=aarch64 -mabi=pauthtest %s 2>&1 | FileCheck %s --check-prefix=ERR3 |
76 | 95 | //// The ABI is not specified explicitly, and for non-Linux pauthtest environment does not correspond
|
77 | 96 | //// to pauthtest ABI (each OS target defines this behavior separately). Do not emit an error.
|
78 | 97 | // RUN: %clang -c --target=aarch64-pauthtest %s -o /dev/null
|
79 |
| -// ERR2: error: unknown target ABI 'pauthtest' |
| 98 | +// ERR3: error: unknown target ABI 'pauthtest' |
80 | 99 |
|
81 | 100 | //// PAuth ABI is encoded as environment part of the triple, so don't allow to explicitly set other environments.
|
82 |
| -// RUN: not %clang -### -c --target=aarch64-linux-gnu -mabi=pauthtest %s 2>&1 | FileCheck %s --check-prefix=ERR3 |
83 |
| -// ERR3: error: unsupported option '-mabi=pauthtest' for target 'aarch64-unknown-linux-gnu' |
| 101 | +// RUN: not %clang -### -c --target=aarch64-linux-gnu -mabi=pauthtest %s 2>&1 | FileCheck %s --check-prefix=ERR4 |
| 102 | +// ERR4: error: unsupported option '-mabi=pauthtest' for target 'aarch64-unknown-linux-gnu' |
84 | 103 | // RUN: %clang -### -c --target=aarch64-linux-pauthtest -mabi=pauthtest %s
|
85 | 104 |
|
86 | 105 | //// The only branch protection option compatible with PAuthABI is BTI.
|
87 | 106 | // RUN: not %clang -### -c --target=aarch64-linux -mabi=pauthtest -mbranch-protection=pac-ret %s 2>&1 | \
|
88 |
| -// RUN: FileCheck %s --check-prefix=ERR4 |
| 107 | +// RUN: FileCheck %s --check-prefix=ERR5 |
89 | 108 | // RUN: not %clang -### -c --target=aarch64-linux-pauthtest -mbranch-protection=pac-ret %s 2>&1 | \
|
90 |
| -// RUN: FileCheck %s --check-prefix=ERR4 |
91 |
| -// ERR4: error: unsupported option '-mbranch-protection=pac-ret' for target 'aarch64-unknown-linux-pauthtest' |
| 109 | +// RUN: FileCheck %s --check-prefix=ERR5 |
| 110 | +// ERR5: error: unsupported option '-mbranch-protection=pac-ret' for target 'aarch64-unknown-linux-pauthtest' |
92 | 111 |
|
93 | 112 | // RUN: not %clang -### -c --target=aarch64-linux -mabi=pauthtest -mbranch-protection=gcs %s 2>&1 | \
|
94 |
| -// RUN: FileCheck %s --check-prefix=ERR5 |
| 113 | +// RUN: FileCheck %s --check-prefix=ERR6 |
95 | 114 | // RUN: not %clang -### -c --target=aarch64-linux-pauthtest -mbranch-protection=gcs %s 2>&1 | \
|
96 |
| -// RUN: FileCheck %s --check-prefix=ERR5 |
97 |
| -// ERR5: error: unsupported option '-mbranch-protection=gcs' for target 'aarch64-unknown-linux-pauthtest' |
| 115 | +// RUN: FileCheck %s --check-prefix=ERR6 |
| 116 | +// ERR6: error: unsupported option '-mbranch-protection=gcs' for target 'aarch64-unknown-linux-pauthtest' |
98 | 117 |
|
99 | 118 | // RUN: not %clang -### -c --target=aarch64-linux -mabi=pauthtest -mbranch-protection=standard %s 2>&1 | \
|
100 |
| -// RUN: FileCheck %s --check-prefix=ERR6 |
| 119 | +// RUN: FileCheck %s --check-prefix=ERR7 |
101 | 120 | // RUN: not %clang -### -c --target=aarch64-linux-pauthtest -mbranch-protection=standard %s 2>&1 | \
|
102 |
| -// RUN: FileCheck %s --check-prefix=ERR6 |
103 |
| -// ERR6: error: unsupported option '-mbranch-protection=standard' for target 'aarch64-unknown-linux-pauthtest' |
| 121 | +// RUN: FileCheck %s --check-prefix=ERR7 |
| 122 | +// ERR7: error: unsupported option '-mbranch-protection=standard' for target 'aarch64-unknown-linux-pauthtest' |
104 | 123 |
|
105 | 124 | // RUN: not %clang -### -c --target=aarch64-linux -mabi=pauthtest -msign-return-address=all %s 2>&1 | \
|
106 |
| -// RUN: FileCheck %s --check-prefix=ERR7 |
| 125 | +// RUN: FileCheck %s --check-prefix=ERR8 |
107 | 126 | // RUN: not %clang -### -c --target=aarch64-linux-pauthtest -msign-return-address=all %s 2>&1 | \
|
108 |
| -// RUN: FileCheck %s --check-prefix=ERR7 |
109 |
| -// ERR7: error: unsupported option '-msign-return-address=all' for target 'aarch64-unknown-linux-pauthtest' |
| 127 | +// RUN: FileCheck %s --check-prefix=ERR8 |
| 128 | +// ERR8: error: unsupported option '-msign-return-address=all' for target 'aarch64-unknown-linux-pauthtest' |
110 | 129 |
|
111 | 130 | // RUN: not %clang -### -c --target=aarch64-linux -mabi=pauthtest -msign-return-address=non-leaf %s 2>&1 | \
|
112 |
| -// RUN: FileCheck %s --check-prefix=ERR8 |
| 131 | +// RUN: FileCheck %s --check-prefix=ERR9 |
113 | 132 | // RUN: not %clang -### -c --target=aarch64-linux-pauthtest -msign-return-address=non-leaf %s 2>&1 | \
|
114 |
| -// RUN: FileCheck %s --check-prefix=ERR8 |
115 |
| -// ERR8: error: unsupported option '-msign-return-address=non-leaf' for target 'aarch64-unknown-linux-pauthtest' |
| 133 | +// RUN: FileCheck %s --check-prefix=ERR9 |
| 134 | +// ERR9: error: unsupported option '-msign-return-address=non-leaf' for target 'aarch64-unknown-linux-pauthtest' |
116 | 135 |
|
117 | 136 | // RUN: %clang -### -c --target=aarch64-linux -mabi=pauthtest -msign-return-address=none %s
|
118 | 137 | // RUN: %clang -### -c --target=aarch64-linux-pauthtest -msign-return-address=none %s
|
|
0 commit comments