1
- // RUN: %clang_cc1 %s -E -triple=arm64-- | FileCheck %s --check-prefixes=NOINTRIN
2
- // RUN: %clang_cc1 %s -E -triple=arm64-- -fptrauth-intrinsics | FileCheck %s --check-prefixes=INTRIN
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
9
+
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
17
+
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
25
+
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
33
+
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
41
+
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
49
+
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
3
57
4
58
#if __has_feature (ptrauth_intrinsics )
5
59
// INTRIN: has_ptrauth_intrinsics
@@ -8,3 +62,52 @@ void has_ptrauth_intrinsics() {}
8
62
// NOINTRIN: no_ptrauth_intrinsics
9
63
void no_ptrauth_intrinsics () {}
10
64
#endif
65
+
66
+ #if __has_feature (ptrauth_calls )
67
+ // CALLS: has_ptrauth_calls
68
+ void has_ptrauth_calls () {}
69
+ #else
70
+ // NOCALLS: no_ptrauth_calls
71
+ void no_ptrauth_calls () {}
72
+ #endif
73
+
74
+ // This is always enabled when ptrauth_calls is enabled
75
+ #if __has_feature (ptrauth_member_function_pointer_type_discrimination )
76
+ // CALLS: has_ptrauth_member_function_pointer_type_discrimination
77
+ void has_ptrauth_member_function_pointer_type_discrimination () {}
78
+ #else
79
+ // NOCALLS: no_ptrauth_member_function_pointer_type_discrimination
80
+ void no_ptrauth_member_function_pointer_type_discrimination () {}
81
+ #endif
82
+
83
+ #if __has_feature (ptrauth_returns )
84
+ // RETS: has_ptrauth_returns
85
+ void has_ptrauth_returns () {}
86
+ #else
87
+ // NORETS: no_ptrauth_returns
88
+ void no_ptrauth_returns () {}
89
+ #endif
90
+
91
+ #if __has_feature (ptrauth_vtable_pointer_address_discrimination )
92
+ // VPTR_ADDR_DISCR: has_ptrauth_vtable_pointer_address_discrimination
93
+ void has_ptrauth_vtable_pointer_address_discrimination () {}
94
+ #else
95
+ // NOVPTR_ADDR_DISCR: no_ptrauth_vtable_pointer_address_discrimination
96
+ void no_ptrauth_vtable_pointer_address_discrimination () {}
97
+ #endif
98
+
99
+ #if __has_feature (ptrauth_vtable_pointer_type_discrimination )
100
+ // VPTR_TYPE_DISCR: has_ptrauth_vtable_pointer_type_discrimination
101
+ void has_ptrauth_vtable_pointer_type_discrimination () {}
102
+ #else
103
+ // NOVPTR_TYPE_DISCR: no_ptrauth_vtable_pointer_type_discrimination
104
+ void no_ptrauth_vtable_pointer_type_discrimination () {}
105
+ #endif
106
+
107
+ #if __has_feature (ptrauth_init_fini )
108
+ // INITFINI: has_ptrauth_init_fini
109
+ void has_ptrauth_init_fini () {}
110
+ #else
111
+ // NOINITFINI: no_ptrauth_init_fini
112
+ void no_ptrauth_init_fini () {}
113
+ #endif
0 commit comments