|
4 | 4 | // NONE: "-cc1"
|
5 | 5 | // NONE-NOT: "-fptrauth-
|
6 | 6 |
|
| 7 | +//// -fptauth-* driver flags are only supported for pauthtest ABI |
| 8 | +// RUN: %clang -### -c --target=aarch64-linux -mabi=pauthtest \ |
| 9 | +// RUN: -fno-ptrauth-intrinsics -fptrauth-intrinsics \ |
| 10 | +// RUN: -fno-ptrauth-calls -fptrauth-calls \ |
| 11 | +// RUN: -fno-ptrauth-returns -fptrauth-returns \ |
| 12 | +// RUN: -fno-ptrauth-auth-traps -fptrauth-auth-traps \ |
| 13 | +// RUN: -fno-ptrauth-vtable-pointer-address-discrimination -fptrauth-vtable-pointer-address-discrimination \ |
| 14 | +// RUN: -fno-ptrauth-vtable-pointer-type-discrimination -fptrauth-vtable-pointer-type-discrimination \ |
| 15 | +// RUN: -fno-ptrauth-type-info-vtable-pointer-discrimination -fptrauth-type-info-vtable-pointer-discrimination \ |
| 16 | +// RUN: -fno-ptrauth-indirect-gotos -fptrauth-indirect-gotos \ |
| 17 | +// RUN: -fno-ptrauth-init-fini -fptrauth-init-fini \ |
| 18 | +// RUN: -fno-ptrauth-init-fini-address-discrimination -fptrauth-init-fini-address-discrimination \ |
| 19 | +// RUN: -fno-ptrauth-elf-got -fptrauth-elf-got \ |
| 20 | +// RUN: -fno-aarch64-jump-table-hardening -faarch64-jump-table-hardening \ |
| 21 | +// RUN: %s 2>&1 | FileCheck %s --check-prefix=ALL-LINUX-PAUTHTEST |
| 22 | +// RUN: %clang -### -c --target=aarch64-linux-pauthtest \ |
| 23 | +// RUN: -fno-ptrauth-intrinsics -fptrauth-intrinsics \ |
| 24 | +// RUN: -fno-ptrauth-calls -fptrauth-calls \ |
| 25 | +// RUN: -fno-ptrauth-returns -fptrauth-returns \ |
| 26 | +// RUN: -fno-ptrauth-auth-traps -fptrauth-auth-traps \ |
| 27 | +// RUN: -fno-ptrauth-vtable-pointer-address-discrimination -fptrauth-vtable-pointer-address-discrimination \ |
| 28 | +// RUN: -fno-ptrauth-vtable-pointer-type-discrimination -fptrauth-vtable-pointer-type-discrimination \ |
| 29 | +// RUN: -fno-ptrauth-type-info-vtable-pointer-discrimination -fptrauth-type-info-vtable-pointer-discrimination \ |
| 30 | +// RUN: -fno-ptrauth-indirect-gotos -fptrauth-indirect-gotos \ |
| 31 | +// RUN: -fno-ptrauth-init-fini -fptrauth-init-fini \ |
| 32 | +// RUN: -fno-ptrauth-init-fini-address-discrimination -fptrauth-init-fini-address-discrimination \ |
| 33 | +// RUN: -fno-ptrauth-elf-got -fptrauth-elf-got \ |
| 34 | +// RUN: -fno-aarch64-jump-table-hardening -faarch64-jump-table-hardening \ |
| 35 | +// RUN: %s 2>&1 | FileCheck %s --check-prefix=ALL-LINUX-PAUTHTEST |
| 36 | +// ALL-LINUX-PAUTHTEST: "-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" "-fptrauth-elf-got"{{.*}} "-faarch64-jump-table-hardening" |
| 37 | + |
7 | 38 | // RUN: %clang -### -c --target=aarch64-linux \
|
8 | 39 | // RUN: -fno-aarch64-jump-table-hardening -faarch64-jump-table-hardening \
|
9 | 40 | // RUN: %s 2>&1 | FileCheck %s --check-prefix=ALL-LINUX
|
|
22 | 53 | // RUN: %s 2>&1 | FileCheck %s --check-prefix=ALL-DARWIN
|
23 | 54 | // ALL-DARWIN: "-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"{{.*}} "-faarch64-jump-table-hardening"
|
24 | 55 |
|
25 |
| -// RUN: %clang -### -c --target=aarch64-linux -mabi=pauthtest %s 2>&1 | FileCheck %s --check-prefix=PAUTHABI1 |
26 |
| -// RUN: %clang -### -c --target=aarch64-linux-pauthtest %s 2>&1 | FileCheck %s --check-prefix=PAUTHABI1 |
27 |
| -// PAUTHABI1: "-cc1"{{.*}} "-triple" "aarch64-unknown-linux-pauthtest" |
28 |
| -// PAUTHABI1-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" |
29 |
| -// PAUTHABI1-SAME: "-target-abi" "pauthtest" |
30 |
| -// PAUTHABI1-NOT: "-fptrauth-function-pointer-type-discrimination" |
31 |
| - |
32 |
| -// RUN: %clang -### -c --target=aarch64-linux -mabi=pauthtest \ |
33 |
| -// RUN: -fno-aarch64-jump-table-hardening %s 2>&1 | FileCheck %s --check-prefix=PAUTHABI2 |
34 |
| -// RUN: %clang -### -c --target=aarch64-linux-pauthtest \ |
35 |
| -// RUN: -fno-aarch64-jump-table-hardening %s 2>&1 | FileCheck %s --check-prefix=PAUTHABI2 |
| 56 | +// RUN: %clang -### -c --target=aarch64-linux -mabi=pauthtest %s 2>&1 | FileCheck %s --check-prefix=PAUTHTEST1 |
| 57 | +// RUN: %clang -### -c --target=aarch64-linux-pauthtest %s 2>&1 | FileCheck %s --check-prefix=PAUTHTEST1 |
| 58 | +// PAUTHTEST1: "-cc1"{{.*}} "-triple" "aarch64-unknown-linux-pauthtest" |
| 59 | +// 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 | +// PAUTHTEST1-SAME: "-target-abi" "pauthtest" |
| 61 | +// PAUTHTEST1-NOT: "-fptrauth-function-pointer-type-discrimination" |
| 62 | + |
| 63 | +// RUN: %clang -### -c --target=aarch64-linux -mabi=pauthtest -fno-ptrauth-intrinsics \ |
| 64 | +// RUN: -fno-ptrauth-calls -fno-ptrauth-returns -fno-ptrauth-auth-traps \ |
| 65 | +// RUN: -fno-ptrauth-vtable-pointer-address-discrimination -fno-ptrauth-vtable-pointer-type-discrimination \ |
| 66 | +// RUN: -fno-ptrauth-type-info-vtable-pointer-discrimination -fno-ptrauth-indirect-gotos \ |
| 67 | +// RUN: -fno-ptrauth-init-fini -fno-ptrauth-init-fini-address-discrimination \ |
| 68 | +// RUN: -fno-aarch64-jump-table-hardening %s 2>&1 | FileCheck %s --check-prefix=PAUTHTEST2 |
| 69 | +// RUN: %clang -### -c --target=aarch64-linux-pauthtest -fno-ptrauth-intrinsics \ |
| 70 | +// RUN: -fno-ptrauth-calls -fno-ptrauth-returns -fno-ptrauth-auth-traps \ |
| 71 | +// RUN: -fno-ptrauth-vtable-pointer-address-discrimination -fno-ptrauth-vtable-pointer-type-discrimination \ |
| 72 | +// RUN: -fno-ptrauth-type-info-vtable-pointer-discrimination -fno-ptrauth-indirect-gotos \ |
| 73 | +// RUN: -fno-ptrauth-init-fini -fno-ptrauth-init-fini-address-discrimination \ |
| 74 | +// RUN: -fno-aarch64-jump-table-hardening %s 2>&1 | FileCheck %s --check-prefix=PAUTHTEST2 |
36 | 75 |
|
37 | 76 | //// Non-linux OS: pauthtest ABI has no effect in terms of passing ptrauth cc1 flags.
|
38 | 77 | //// An error about unsupported ABI will be emitted later in pipeline (see ERR3 below)
|
39 |
| -// RUN: %clang -### -c --target=aarch64 -mabi=pauthtest %s 2>&1 | FileCheck %s --check-prefixes=PAUTHABI2,PAUTHABI3 |
| 78 | +// RUN: %clang -### -c --target=aarch64 -mabi=pauthtest %s 2>&1 | FileCheck %s --check-prefixes=PAUTHTEST2 |
40 | 79 |
|
41 |
| -// PAUTHABI2: "-cc1" |
42 |
| -// PAUTHABI2-SAME: "-target-abi" "pauthtest" |
43 |
| -// PAUTHABI3-NOT: "-fptrauth- |
44 |
| -// PAUTHABI2-NOT: "-faarch64-jump-table-hardening" |
| 80 | +// PAUTHTEST2: "-cc1" |
| 81 | +// PAUTHTEST2-SAME: "-target-abi" "pauthtest" |
| 82 | +// PAUTHTEST2-NOT: "-fptrauth- |
| 83 | +// PAUTHTEST2-NOT: "-faarch64-jump-table-hardening" |
45 | 84 |
|
46 | 85 | //// Non-linux OS: pauthtest environment does not correspond to pauthtest ABI; aapcs is the default.
|
47 |
| -// RUN: %clang -### -c --target=aarch64-pauthtest %s 2>&1 | FileCheck %s --check-prefix=PAUTHABI4 |
48 |
| -// PAUTHABI4: "-cc1" |
49 |
| -// PAUTHABI4-SAME: "-target-abi" "aapcs" |
50 |
| -// PAUTHABI4-NOT: "-fptrauth- |
51 |
| -// PAUTHABI4-NOT: "-faarch64-jump-table-hardening" |
52 |
| - |
53 |
| -//// Non-AArch64. |
54 |
| -// RUN: not %clang -### -c --target=x86_64-linux -fptrauth-intrinsics -fptrauth-calls -fptrauth-returns -fptrauth-auth-traps \ |
| 86 | +// RUN: %clang -### -c --target=aarch64-pauthtest %s 2>&1 | FileCheck %s --check-prefix=PAUTHTEST3 |
| 87 | +// PAUTHTEST3: "-cc1" |
| 88 | +// PAUTHTEST3-SAME: "-target-abi" "aapcs" |
| 89 | +// PAUTHTEST3-NOT: "-fptrauth- |
| 90 | +// PAUTHTEST3-NOT: "-faarch64-jump-table-hardening" |
| 91 | + |
| 92 | +//// Non-pauthtest ABI. |
| 93 | +// RUN: not %clang -### -c --target=aarch64-linux -fptrauth-intrinsics -fptrauth-calls -fptrauth-returns -fptrauth-auth-traps \ |
55 | 94 | // RUN: -fptrauth-vtable-pointer-address-discrimination -fptrauth-vtable-pointer-type-discrimination \
|
56 | 95 | // RUN: -fptrauth-type-info-vtable-pointer-discrimination -fptrauth-indirect-gotos -fptrauth-init-fini \
|
57 |
| -// RUN: -fptrauth-init-fini-address-discrimination -faarch64-jump-table-hardening %s 2>&1 | FileCheck %s --check-prefixes=ERR1,ERR2 |
58 |
| -//// Non-linux and non-Darwin OS. |
59 |
| -// RUN: not %clang -### -c --target=aarch64 -fptrauth-intrinsics -fptrauth-calls -fptrauth-returns -fptrauth-auth-traps \ |
60 |
| -// RUN: -fptrauth-vtable-pointer-address-discrimination -fptrauth-vtable-pointer-type-discrimination \ |
61 |
| -// RUN: -fptrauth-type-info-vtable-pointer-discrimination -fptrauth-indirect-gotos -fptrauth-init-fini \ |
62 |
| -// RUN: -fptrauth-init-fini-address-discrimination -faarch64-jump-table-hardening %s 2>&1 | FileCheck %s --check-prefix=ERR1 |
| 96 | +// RUN: -fptrauth-init-fini-address-discrimination -fptrauth-elf-got %s 2>&1 | FileCheck %s --check-prefix=ERR1 |
63 | 97 | // ERR1: error: unsupported option '-fptrauth-intrinsics' for target '{{.*}}'
|
64 | 98 | // ERR1-NEXT: error: unsupported option '-fptrauth-calls' for target '{{.*}}'
|
65 | 99 | // ERR1-NEXT: error: unsupported option '-fptrauth-returns' for target '{{.*}}'
|
|
70 | 104 | // ERR1-NEXT: error: unsupported option '-fptrauth-indirect-gotos' for target '{{.*}}'
|
71 | 105 | // ERR1-NEXT: error: unsupported option '-fptrauth-init-fini' for target '{{.*}}'
|
72 | 106 | // ERR1-NEXT: error: unsupported option '-fptrauth-init-fini-address-discrimination' for target '{{.*}}'
|
73 |
| -// ERR2-NEXT: error: unsupported option '-faarch64-jump-table-hardening' for target '{{.*}}' |
| 107 | +// ERR1-NEXT: error: unsupported option '-fptrauth-elf-got' for target '{{.*}}' |
74 | 108 |
|
| 109 | +//// Non-AArch64. |
| 110 | +// RUN: not %clang -### -c --target=x86_64-linux -faarch64-jump-table-hardening %s 2>&1 | FileCheck %s --check-prefixes=ERR2 |
| 111 | +// ERR2: error: unsupported option '-faarch64-jump-table-hardening' for target '{{.*}}' |
75 | 112 |
|
76 | 113 | // RUN: not %clang -c --target=aarch64 -mabi=pauthtest %s 2>&1 | FileCheck %s --check-prefix=ERR3
|
77 | 114 | //// The ABI is not specified explicitly, and for non-Linux pauthtest environment does not correspond
|
|
0 commit comments