|
1 | | -// RUN: %clang_cc1 -E %s -triple=aarch64 \ |
2 | | -// RUN: -fptrauth-intrinsics \ |
3 | | -// RUN: -fptrauth-calls \ |
4 | | -// RUN: -fptrauth-returns \ |
5 | | -// RUN: -fptrauth-vtable-pointer-address-discrimination \ |
6 | | -// RUN: -fptrauth-vtable-pointer-type-discrimination \ |
7 | | -// RUN: -fptrauth-init-fini | \ |
8 | | -// RUN: FileCheck %s --check-prefixes=INTRIN,CALLS,RETS,VPTR_ADDR_DISCR,VPTR_TYPE_DISCR,INITFINI,NOFUNC |
| 1 | +//// Note: preprocessor features exactly match corresponding clang driver flags. However, some flags are only intended to be used in combination with other ones. |
| 2 | +//// For example, -fptrauth-init-fini will not affect codegen without -fptrauth-calls, but the preprocessor feature would be set anyway. |
9 | 3 |
|
10 | | -// RUN: %clang_cc1 -E %s -triple=aarch64 \ |
11 | | -// RUN: -fptrauth-calls \ |
12 | | -// RUN: -fptrauth-returns \ |
13 | | -// RUN: -fptrauth-vtable-pointer-address-discrimination \ |
14 | | -// RUN: -fptrauth-vtable-pointer-type-discrimination \ |
15 | | -// RUN: -fptrauth-init-fini | \ |
16 | | -// RUN: FileCheck %s --check-prefixes=NOINTRIN,CALLS,RETS,VPTR_ADDR_DISCR,VPTR_TYPE_DISCR,INITFINI,NOFUNC |
| 4 | +// RUN: %clang_cc1 -E %s -triple=aarch64 -fptrauth-intrinsics | \ |
| 5 | +// RUN: FileCheck %s --check-prefixes=INTRIN,NOCALLS,NORETS,NOVPTR_ADDR_DISCR,NOVPTR_TYPE_DISCR,NOFUNC,NOINITFINI |
17 | 6 |
|
18 | | -// RUN: %clang_cc1 -E %s -triple=aarch64 \ |
19 | | -// RUN: -fptrauth-intrinsics \ |
20 | | -// RUN: -fptrauth-returns \ |
21 | | -// RUN: -fptrauth-vtable-pointer-address-discrimination \ |
22 | | -// RUN: -fptrauth-vtable-pointer-type-discrimination \ |
23 | | -// RUN: -fptrauth-init-fini | \ |
24 | | -// RUN: FileCheck %s --check-prefixes=INTRIN,NOCALLS,RETS,VPTR_ADDR_DISCR,VPTR_TYPE_DISCR,INITFINI,NOFUNC |
| 7 | +// RUN: %clang_cc1 -E %s -triple=aarch64 -fptrauth-calls | \ |
| 8 | +// RUN: FileCheck %s --check-prefixes=NOINTRIN,CALLS,NORETS,NOVPTR_ADDR_DISCR,NOVPTR_TYPE_DISCR,NOFUNC,NOINITFINI |
25 | 9 |
|
26 | | -// RUN: %clang_cc1 -E %s -triple=aarch64 \ |
27 | | -// RUN: -fptrauth-intrinsics \ |
28 | | -// RUN: -fptrauth-calls \ |
29 | | -// RUN: -fptrauth-vtable-pointer-address-discrimination \ |
30 | | -// RUN: -fptrauth-vtable-pointer-type-discrimination \ |
31 | | -// RUN: -fptrauth-init-fini | \ |
32 | | -// RUN: FileCheck %s --check-prefixes=INTRIN,CALLS,NORETS,VPTR_ADDR_DISCR,VPTR_TYPE_DISCR,INITFINI,NOFUNC |
| 10 | +// RUN: %clang_cc1 -E %s -triple=aarch64 -fptrauth-returns | \ |
| 11 | +// RUN: FileCheck %s --check-prefixes=NOINTRIN,NOCALLS,RETS,NOVPTR_ADDR_DISCR,NOVPTR_TYPE_DISCR,NOFUNC,NOINITFINI |
33 | 12 |
|
34 | | -// RUN: %clang_cc1 -E %s -triple=aarch64 \ |
35 | | -// RUN: -fptrauth-intrinsics \ |
36 | | -// RUN: -fptrauth-calls \ |
37 | | -// RUN: -fptrauth-returns \ |
38 | | -// RUN: -fptrauth-vtable-pointer-type-discrimination \ |
39 | | -// RUN: -fptrauth-init-fini | \ |
40 | | -// RUN: FileCheck %s --check-prefixes=INTRIN,CALLS,RETS,NOVPTR_ADDR_DISCR,VPTR_TYPE_DISCR,INITFINI,NOFUNC |
| 13 | +// RUN: %clang_cc1 -E %s -triple=aarch64 -fptrauth-vtable-pointer-address-discrimination | \ |
| 14 | +// RUN: FileCheck %s --check-prefixes=NOINTRIN,NOCALLS,NORETS,VPTR_ADDR_DISCR,NOVPTR_TYPE_DISCR,NOFUNC,NOINITFINI |
41 | 15 |
|
42 | | -// RUN: %clang_cc1 -E %s -triple=aarch64 \ |
43 | | -// RUN: -fptrauth-intrinsics \ |
44 | | -// RUN: -fptrauth-calls \ |
45 | | -// RUN: -fptrauth-returns \ |
46 | | -// RUN: -fptrauth-vtable-pointer-address-discrimination \ |
47 | | -// RUN: -fptrauth-init-fini | \ |
48 | | -// RUN: FileCheck %s --check-prefixes=INTRIN,CALLS,RETS,VPTR_ADDR_DISCR,NOVPTR_TYPE_DISCR,INITFINI,NOFUNC |
| 16 | +// RUN: %clang_cc1 -E %s -triple=aarch64 -fptrauth-vtable-pointer-type-discrimination | \ |
| 17 | +// RUN: FileCheck %s --check-prefixes=NOINTRIN,NOCALLS,NORETS,NOVPTR_ADDR_DISCR,VPTR_TYPE_DISCR,NOFUNC,NOINITFINI |
49 | 18 |
|
50 | | -// RUN: %clang_cc1 -E %s -triple=aarch64 \ |
51 | | -// RUN: -fptrauth-intrinsics \ |
52 | | -// RUN: -fptrauth-calls \ |
53 | | -// RUN: -fptrauth-returns \ |
54 | | -// RUN: -fptrauth-vtable-pointer-address-discrimination \ |
55 | | -// RUN: -fptrauth-vtable-pointer-type-discrimination | \ |
56 | | -// RUN: FileCheck %s --check-prefixes=INTRIN,CALLS,RETS,VPTR_ADDR_DISCR,VPTR_TYPE_DISCR,NOINITFINI,NOFUNC |
57 | | - |
58 | | -// RUN: %clang_cc1 -E %s -triple=aarch64 \ |
59 | | -// RUN: -fptrauth-intrinsics \ |
60 | | -// RUN: -fptrauth-calls \ |
61 | | -// RUN: -fptrauth-returns \ |
62 | | -// RUN: -fptrauth-vtable-pointer-address-discrimination \ |
63 | | -// RUN: -fptrauth-vtable-pointer-type-discrimination \ |
64 | | -// RUN: -fptrauth-function-pointer-type-discrimination | \ |
65 | | -// RUN: FileCheck %s --check-prefixes=INTRIN,CALLS,RETS,VPTR_ADDR_DISCR,VPTR_TYPE_DISCR,NOINITFINI,FUNC |
| 19 | +// RUN: %clang_cc1 -E %s -triple=aarch64 -fptrauth-function-pointer-type-discrimination | \ |
| 20 | +// RUN: FileCheck %s --check-prefixes=NOINTRIN,NOCALLS,NORETS,NOVPTR_ADDR_DISCR,NOVPTR_TYPE_DISCR,FUNC,NOINITFINI |
66 | 21 |
|
| 22 | +// RUN: %clang_cc1 -E %s -triple=aarch64 -fptrauth-init-fini | \ |
| 23 | +// RUN: FileCheck %s --check-prefixes=NOINTRIN,NOCALLS,NORETS,NOVPTR_ADDR_DISCR,NOVPTR_TYPE_DISCR,NOFUNC,INITFINI |
67 | 24 |
|
68 | 25 | #if __has_feature(ptrauth_intrinsics) |
69 | 26 | // INTRIN: has_ptrauth_intrinsics |
@@ -114,20 +71,18 @@ void has_ptrauth_vtable_pointer_type_discrimination() {} |
114 | 71 | void no_ptrauth_vtable_pointer_type_discrimination() {} |
115 | 72 | #endif |
116 | 73 |
|
117 | | -#if __has_feature(ptrauth_init_fini) |
118 | | -// INITFINI: has_ptrauth_init_fini |
119 | | -void has_ptrauth_init_fini() {} |
120 | | -#else |
121 | | -// NOINITFINI: no_ptrauth_init_fini |
122 | | -void no_ptrauth_init_fini() {} |
123 | | -#endif |
124 | | - |
125 | | -#include <ptrauth.h> |
126 | | - |
127 | 74 | #if __has_feature(ptrauth_function_pointer_type_discrimination) |
128 | 75 | // FUNC: has_ptrauth_function_pointer_type_discrimination |
129 | 76 | void has_ptrauth_function_pointer_type_discrimination() {} |
130 | 77 | #else |
131 | 78 | // NOFUNC: no_ptrauth_function_pointer_type_discrimination |
132 | 79 | void no_ptrauth_function_pointer_type_discrimination() {} |
133 | 80 | #endif |
| 81 | + |
| 82 | +#if __has_feature(ptrauth_init_fini) |
| 83 | +// INITFINI: has_ptrauth_init_fini |
| 84 | +void has_ptrauth_init_fini() {} |
| 85 | +#else |
| 86 | +// NOINITFINI: no_ptrauth_init_fini |
| 87 | +void no_ptrauth_init_fini() {} |
| 88 | +#endif |
0 commit comments