Debian Codegraph @

clang/test/Preprocessor/hexagon-predefines.c

raw
1 // RUN: %clang_cc1 -E -dM -triple hexagon-unknown-elf -target-cpu hexagonv5 %s | FileCheck %s -check-prefix CHECK-V5
2 // CHECK-V5: #define __HEXAGON_ARCH__ 5
3 // CHECK-V5: #define __HEXAGON_V5__ 1
4 // CHECK-V5-NOT: #define __HVX_LENGTH__
5 // CHECK-V5-NOT: #define __HVX__ 1
6 // CHECK-V5: #define __hexagon__ 1
7
8 // RUN: %clang_cc1 -E -dM -triple hexagon-unknown-elf -target-cpu hexagonv55 %s | FileCheck %s -check-prefix CHECK-V55
9 // CHECK-V55: #define __HEXAGON_ARCH__ 55
10 // CHECK-V55: #define __HEXAGON_V55__ 1
11 // CHECK-V55-NOT: #define __HVX_LENGTH__
12 // CHECK-V55-NOT: #define __HVX__ 1
13 // CHECK-V55: #define __hexagon__ 1
14
15 // RUN: %clang_cc1 -E -dM -triple hexagon-unknown-elf -target-cpu hexagonv60 %s | FileCheck %s -check-prefix CHECK-V60
16 // CHECK-V60: #define __HEXAGON_ARCH__ 60
17 // CHECK-V60: #define __HEXAGON_V60__ 1
18 // CHECK-V60-NOT: #define __HVX_LENGTH__
19 // CHECK-V60-NOT: #define __HVX__ 1
20 // CHECK-V60: #define __hexagon__ 1
21
22 // RUN: %clang_cc1 -E -dM -triple hexagon-unknown-elf -target-cpu hexagonv62 %s | FileCheck %s -check-prefix CHECK-V62
23 // CHECK-V62: #define __HEXAGON_ARCH__ 62
24 // CHECK-V62: #define __HEXAGON_V62__ 1
25 // CHECK-V62-NOT: #define __HVX_LENGTH__
26 // CHECK-V62-NOT: #define __HVX__ 1
27 // CHECK-V62: #define __hexagon__ 1
28
29 // RUN: %clang_cc1 -E -dM -triple hexagon-unknown-elf -target-cpu hexagonv65 %s | FileCheck %s -check-prefix CHECK-V65
30 // CHECK-V65: #define __HEXAGON_ARCH__ 65
31 // CHECK-V65: #define __HEXAGON_V65__ 1
32 // CHECK-V65-NOT: #define __HVX_LENGTH__
33 // CHECK-V65-NOT: #define __HVX__ 1
34 // CHECK-V65: #define __hexagon__ 1
35
36 // RUN: %clang_cc1 -E -dM -triple hexagon-unknown-elf -target-cpu hexagonv66 %s | FileCheck %s -check-prefix CHECK-V66
37 // CHECK-V66: #define __HEXAGON_ARCH__ 66
38 // CHECK-V66: #define __HEXAGON_V66__ 1
39 // CHECK-V66-NOT: #define __HVX_LENGTH__
40 // CHECK-V66-NOT: #define __HVX__ 1
41 // CHECK-V66: #define __hexagon__ 1
42
43 // The HVX flags are explicitly defined by the driver.
44 // For v60,v62,v65 - 64B mode is default
45 // For v66 and future archs - 128B is default
46 // RUN: %clang_cc1 -E -dM -triple hexagon-unknown-elf -target-cpu hexagonv60 \
47 // RUN: -target-feature +hvxv60 -target-feature +hvx-length64b %s | FileCheck \
48 // RUN: %s -check-prefix CHECK-V60HVX-64B
49 // CHECK-V60HVX-64B: #define __HEXAGON_ARCH__ 60
50 // CHECK-V60HVX-64B: #define __HEXAGON_V60__ 1
51 // CHECK-V60HVX-64B-NOT: #define __HVXDBL__ 1
52 // CHECK-V60HVX-64B: #define __HVX_ARCH__ 60
53 // CHECK-V60HVX-64B: #define __HVX_LENGTH__ 64
54 // CHECK-V60HVX-64B: #define __HVX__ 1
55 // CHECK-V60HVX-64B: #define __hexagon__ 1
56
57 // RUN: %clang_cc1 -E -dM -triple hexagon-unknown-elf -target-cpu hexagonv60 \
58 // RUN: -target-feature +hvxv60 -target-feature +hvx-length128b %s | FileCheck \
59 // RUN: %s -check-prefix CHECK-V60HVX-128B
60 // CHECK-V60HVX-128B: #define __HEXAGON_ARCH__ 60
61 // CHECK-V60HVX-128B: #define __HEXAGON_V60__ 1
62 // CHECK-V60HVX-128B: #define __HVXDBL__ 1
63 // CHECK-V60HVX-128B: #define __HVX_ARCH__ 60
64 // CHECK-V60HVX-128B: #define __HVX_LENGTH__ 128
65 // CHECK-V60HVX-128B: #define __HVX__ 1
66 // CHECK-V60HVX-128B: #define __hexagon__ 1
67
68 // RUN: %clang_cc1 -E -dM -triple hexagon-unknown-elf -target-cpu hexagonv66 \
69 // RUN: -target-feature +hvxv66 -target-feature +hvx-length64b %s | FileCheck \
70 // RUN: %s -check-prefix CHECK-V66HVX-64B
71 // CHECK-V66HVX-64B: #define __HEXAGON_ARCH__ 66
72 // CHECK-V66HVX-64B: #define __HEXAGON_V66__ 1
73 // CHECK-V66HVX-64B-NOT: #define __HVXDBL__ 1
74 // CHECK-V66HVX-64B: #define __HVX_ARCH__ 66
75 // CHECK-V66HVX-64B: #define __HVX_LENGTH__ 64
76 // CHECK-V66HVX-64B: #define __HVX__ 1
77 // CHECK-V66HVX-64B: #define __hexagon__ 1
78
79 // RUN: %clang_cc1 -E -dM -triple hexagon-unknown-elf -target-cpu hexagonv66 \
80 // RUN: -target-feature +hvxv66 -target-feature +hvx-length128b %s | FileCheck \
81 // RUN: %s -check-prefix CHECK-V66HVX-128B
82 // CHECK-V66HVX-128B: #define __HEXAGON_ARCH__ 66
83 // CHECK-V66HVX-128B: #define __HEXAGON_V66__ 1
84 // CHECK-V66HVX-128B: #define __HVXDBL__ 1
85 // CHECK-V66HVX-128B: #define __HVX_ARCH__ 66
86 // CHECK-V66HVX-128B: #define __HVX_LENGTH__ 128
87 // CHECK-V66HVX-128B: #define __HVX__ 1
88 // CHECK-V66HVX-128B: #define __hexagon__ 1
89
90 // RUN: %clang_cc1 -E -dM -triple hexagon-unknown-elf -target-cpu hexagonv67 \
91 // RUN: -target-feature +hvxv67 -target-feature +hvx-length128b %s | FileCheck \
92 // RUN: %s -check-prefix CHECK-V67HVX-128B
93 // CHECK-V67HVX-128B: #define __HEXAGON_ARCH__ 67
94 // CHECK-V67HVX-128B: #define __HEXAGON_V67__ 1
95 // CHECK-V67HVX-128B: #define __HVX_ARCH__ 67
96 // CHECK-V67HVX-128B: #define __HVX_LENGTH__ 128
97 // CHECK-V67HVX-128B: #define __HVX__ 1
98 // CHECK-V67HVX-128B: #define __hexagon__ 1
99
100 // RUN: %clang_cc1 -E -dM -triple hexagon-unknown-elf -target-cpu hexagonv68 \
101 // RUN: -target-feature +hvxv68 -target-feature +hvx-length128b %s | FileCheck \
102 // RUN: %s -check-prefix CHECK-V68HVX-128B
103 // CHECK-V68HVX-128B: #define __HEXAGON_ARCH__ 68
104 // CHECK-V68HVX-128B: #define __HEXAGON_V68__ 1
105 // CHECK-V68HVX-128B: #define __HVX_ARCH__ 68
106 // CHECK-V68HVX-128B: #define __HVX_LENGTH__ 128
107 // CHECK-V68HVX-128B: #define __HVX__ 1
108 // CHECK-V68HVX-128B-NOT: #define __HVX_IEEE_FP__ 1
109 // CHECK-V68HVX-128B: #define __hexagon__ 1
110
111 // RUN: %clang_cc1 -E -dM -triple hexagon-unknown-elf -target-cpu hexagonv68 \
112 // RUN: -target-feature +hvxv68 -target-feature +hvx-length128b \
113 // RUN: -target-feature +hvx-ieee-fp %s | FileCheck \
114 // RUN: %s -check-prefix CHECK-V68HVX-IEEE-FP
115 // CHECK-V68HVX-IEEE-FP: #define __HEXAGON_ARCH__ 68
116 // CHECK-V68HVX-IEEE-FP: #define __HEXAGON_V68__ 1
117 // CHECK-V68HVX-IEEE-FP: #define __HVX_ARCH__ 68
118 // CHECK-V68HVX-IEEE-FP: #define __HVX_IEEE_FP__ 1
119 // CHECK-V68HVX-IEEE-FP: #define __HVX_LENGTH__ 128
120 // CHECK-V68HVX-IEEE-FP: #define __HVX__ 1
121 // CHECK-V68HVX-IEEE-FP: #define __hexagon__ 1
122
123 // RUN: %clang_cc1 -E -dM -triple hexagon-unknown-elf -target-cpu hexagonv69 \
124 // RUN: -target-feature +hvxv69 -target-feature +hvx-length128b %s | FileCheck \
125 // RUN: %s -check-prefix CHECK-V69HVX-128B
126 // CHECK-V69HVX-128B: #define __HEXAGON_ARCH__ 69
127 // CHECK-V69HVX-128B: #define __HEXAGON_V69__ 1
128 // CHECK-V69HVX-128B: #define __HVX_ARCH__ 69
129 // CHECK-V69HVX-128B: #define __HVX_LENGTH__ 128
130 // CHECK-V69HVX-128B: #define __HVX__ 1
131 // CHECK-V69HVX-128B: #define __hexagon__ 1
132
133 // RUN: %clang_cc1 -E -dM -triple hexagon-unknown-elf -target-cpu hexagonv71 \
134 // RUN: -target-feature +hvxv71 -target-feature +hvx-length128b %s | FileCheck \
135 // RUN: %s -check-prefix CHECK-V71HVX-128B
136 // CHECK-V71HVX-128B: #define __HEXAGON_ARCH__ 71
137 // CHECK-V71HVX-128B: #define __HEXAGON_V71__ 1
138 // CHECK-V71HVX-128B: #define __HVX_ARCH__ 71
139 // CHECK-V71HVX-128B: #define __HVX_LENGTH__ 128
140 // CHECK-V71HVX-128B: #define __HVX__ 1
141 // CHECK-V71HVX-128B: #define __hexagon__ 1
142
143 // RUN: %clang_cc1 -E -dM -triple hexagon-unknown-elf -target-cpu hexagonv73 \
144 // RUN: -target-feature +hvxv73 -target-feature +hvx-length128b %s | FileCheck \
145 // RUN: %s -check-prefix CHECK-V73HVX-128B
146 // CHECK-V73HVX-128B: #define __HEXAGON_ARCH__ 73
147 // CHECK-V73HVX-128B: #define __HEXAGON_V73__ 1
148 // CHECK-V73HVX-128B: #define __HVX_ARCH__ 73
149 // CHECK-V73HVX-128B: #define __HVX_LENGTH__ 128
150 // CHECK-V73HVX-128B: #define __HVX__ 1
151 // CHECK-V73HVX-128B: #define __hexagon__ 1
152
153 // RUN: %clang_cc1 -E -dM -triple hexagon-unknown-elf -target-cpu hexagonv75 %s\
154 // RUN: | FileCheck %s -check-prefix CHECK-V75
155 // CHECK-V75: #define __HEXAGON_ARCH__ 75
156 // CHECK-V75: #define __HEXAGON_PHYSICAL_SLOTS__ 4
157 // CHECK-V75: #define __HEXAGON_V75__ 1
158 // CHECK-V75: #define __hexagon__ 1
159
160 // RUN: %clang_cc1 -E -dM -triple hexagon-unknown-elf -target-cpu hexagonv75 \
161 // RUN: -target-feature +hvxv75 -target-feature +hvx-length128b %s | FileCheck \
162 // RUN: %s -check-prefix CHECK-V75HVX-128B
163 // CHECK-V75HVX-128B: #define __HEXAGON_ARCH__ 75
164 // CHECK-V75HVX-128B: #define __HEXAGON_V75__ 1
165 // CHECK-V75HVX-128B: #define __HVX_ARCH__ 75
166 // CHECK-V75HVX-128B: #define __HVX_LENGTH__ 128
167 // CHECK-V75HVX-128B: #define __HVX__ 1
168 // CHECK-V75HVX-128B: #define __hexagon__ 1
169
170 // RUN: %clang_cc1 -E -dM -triple hexagon-unknown-elf -target-cpu hexagonv79 %s\
171 // RUN: | FileCheck %s -check-prefix CHECK-V79
172 // CHECK-V79: #define __HEXAGON_ARCH__ 79
173 // CHECK-V79: #define __HEXAGON_PHYSICAL_SLOTS__ 4
174 // CHECK-V79: #define __HEXAGON_V79__ 1
175 // CHECK-V79: #define __hexagon__ 1
176
177 // RUN: %clang_cc1 -E -dM -triple hexagon-unknown-elf -target-cpu hexagonv79 \
178 // RUN: -target-feature +hvxv79 -target-feature +hvx-length128b %s | FileCheck \
179 // RUN: %s -check-prefix CHECK-V79HVX-128B
180 // CHECK-V79HVX-128B: #define __HEXAGON_ARCH__ 79
181 // CHECK-V79HVX-128B: #define __HEXAGON_V79__ 1
182 // CHECK-V79HVX-128B: #define __HVX_ARCH__ 79
183 // CHECK-V79HVX-128B: #define __HVX_LENGTH__ 128
184 // CHECK-V79HVX-128B: #define __HVX__ 1
185 // CHECK-V79HVX-128B: #define __hexagon__ 1
186
187 // RUN: %clang_cc1 -E -dM -triple hexagon-unknown-elf -target-cpu hexagonv81 %s\
188 // RUN: | FileCheck %s -check-prefix CHECK-V81
189 // CHECK-V81: #define __HEXAGON_ARCH__ 81
190 // CHECK-V81: #define __HEXAGON_PHYSICAL_SLOTS__ 4
191 // CHECK-V81: #define __HEXAGON_V81__ 1
192 // CHECK-V81: #define __hexagon__ 1
193
194 // RUN: %clang_cc1 -E -dM -triple hexagon-unknown-elf -target-cpu hexagonv81 \
195 // RUN: -target-feature +hvxv81 -target-feature +hvx-length128b %s | FileCheck \
196 // RUN: %s -check-prefix CHECK-V81HVX-128B
197 // CHECK-V81HVX-128B: #define __HEXAGON_ARCH__ 81
198 // CHECK-V81HVX-128B: #define __HEXAGON_V81__ 1
199 // CHECK-V81HVX-128B: #define __HVX_ARCH__ 81
200 // CHECK-V81HVX-128B: #define __HVX_LENGTH__ 128
201 // CHECK-V81HVX-128B: #define __HVX__ 1
202 // CHECK-V81HVX-128B: #define __hexagon__ 1
203
204 // RUN: %clang_cc1 -E -dM -triple hexagon-unknown-elf -target-cpu hexagonv67 \
205 // RUN: -target-feature +hvxv67 -target-feature +hvx-length128b %s | FileCheck \
206 // RUN: %s -check-prefix CHECK-ELF
207 // CHECK-ELF: #define __ELF__ 1
208
209 // RUN: %clang_cc1 -E -dM -triple hexagon-unknown-linux-musl \
210 // RUN: -target-cpu hexagonv67 -target-feature +hvxv67 \
211 // RUN: -target-feature +hvx-length128b %s | FileCheck \
212 // RUN: %s -check-prefix CHECK-LINUX
213 // CHECK-LINUX: #define __gnu_linux__ 1
214 // CHECK-LINUX: #define __linux 1
215 // CHECK-LINUX: #define __linux__ 1
216 // CHECK-LINUX: #define __unix 1
217 // CHECK-LINUX: #define __unix__ 1
218 // CHECK-LINUX: #define linux 1
219 // CHECK-LINUX: #define unix 1
220
221 // RUN: %clang_cc1 -E -dM -triple hexagon-unknown-linux-musl \
222 // RUN: -target-cpu hexagonv67 -target-feature +hvxv67 \
223 // RUN: -target-feature +hvx-length128b %s | FileCheck \
224 // RUN: %s -check-prefix CHECK-ATOMIC
225 // CHECK-ATOMIC: #define __CLANG_ATOMIC_BOOL_LOCK_FREE 2
226 // CHECK-ATOMIC: #define __CLANG_ATOMIC_CHAR16_T_LOCK_FREE 2
227 // CHECK-ATOMIC: #define __CLANG_ATOMIC_CHAR32_T_LOCK_FREE 2
228 // CHECK-ATOMIC: #define __CLANG_ATOMIC_CHAR_LOCK_FREE 2
229 // CHECK-ATOMIC: #define __CLANG_ATOMIC_INT_LOCK_FREE 2
230 // CHECK-ATOMIC: #define __CLANG_ATOMIC_LLONG_LOCK_FREE 2
231 // CHECK-ATOMIC: #define __CLANG_ATOMIC_LONG_LOCK_FREE 2
232 // CHECK-ATOMIC: #define __CLANG_ATOMIC_POINTER_LOCK_FREE 2
233 // CHECK-ATOMIC: #define __CLANG_ATOMIC_SHORT_LOCK_FREE 2
234 // CHECK-ATOMIC: #define __CLANG_ATOMIC_WCHAR_T_LOCK_FREE 2
235
236 // RUN: %clang_cc1 -E -dM -triple hexagon-unknown-linux-musl \
237 // RUN: -target-cpu hexagonv67 | FileCheck \
238 // RUN: %s -check-prefix CHECK-INTERFERENCE
239 // RUN: %clang_cc1 -E -dM -triple hexagon-unknown-none-elf \
240 // RUN: -target-cpu hexagonv67 | FileCheck \
241 // RUN: %s -check-prefix CHECK-INTERFERENCE
242 // RUN: %clang_cc1 -E -dM -triple hexagon-unknown-none-elf \
243 // RUN: -target-cpu hexagonv71t | FileCheck \
244 // RUN: %s -check-prefix CHECK-INTERFERENCE
245 // CHECK-INTERFERENCE: #define __GCC_CONSTRUCTIVE_SIZE 32
246 // CHECK-INTERFERENCE: #define __GCC_DESTRUCTIVE_SIZE 32
247 // RUN: %clang_cc1 -E -dM -triple hexagon-unknown-none-elf \
248 // RUN: -target-cpu hexagonv73 | FileCheck \
249 // RUN: %s -check-prefix CHECK-INTERFERENCE-73
250 // CHECK-INTERFERENCE-73: #define __GCC_CONSTRUCTIVE_SIZE 64
251 // CHECK-INTERFERENCE-73: #define __GCC_DESTRUCTIVE_SIZE 64