]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/Preprocessor/arm-target-features.c
Vendor import of clang trunk r338150:
[FreeBSD/FreeBSD.git] / test / Preprocessor / arm-target-features.c
1 // RUN: %clang -target armv8a-none-linux-gnu -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V8A %s
2 // CHECK-V8A: #define __ARMEL__ 1
3 // CHECK-V8A: #define __ARM_ARCH 8
4 // CHECK-V8A: #define __ARM_ARCH_8A__ 1
5 // CHECK-V8A: #define __ARM_FEATURE_CRC32 1
6 // CHECK-V8A: #define __ARM_FEATURE_DIRECTED_ROUNDING 1
7 // CHECK-V8A: #define __ARM_FEATURE_NUMERIC_MAXMIN 1
8 // CHECK-V8A-NOT: #define __ARM_FP 0x
9 // CHECK-V8A-NOT: #define __ARM_FEATURE_DOTPROD
10
11 // RUN: %clang -target armv8a-none-linux-gnueabi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V8A-ALLOW-FP-INSTR %s
12 // RUN: %clang -target armv8a-none-linux-gnueabihf -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V8A-ALLOW-FP-INSTR %s
13 // CHECK-V8A-ALLOW-FP-INSTR: #define __ARMEL__ 1
14 // CHECK-V8A-ALLOW-FP-INSTR: #define __ARM_ARCH 8
15 // CHECK-V8A-ALLOW-FP-INSTR: #define __ARM_ARCH_8A__ 1
16 // CHECK-V8A-ALLOW-FP-INSTR: #define __ARM_FEATURE_CRC32 1
17 // CHECK-V8A-ALLOW-FP-INSTR: #define __ARM_FEATURE_DIRECTED_ROUNDING 1
18 // CHECK-V8A-ALLOW-FP-INSTR: #define __ARM_FEATURE_NUMERIC_MAXMIN 1
19 // CHECK-V8A-ALLOW-FP-INSTR: #define __ARM_FP 0xe
20 // CHECK-V8A-ALLOW-FP-INSTR: #define __ARM_FP16_ARGS 1
21 // CHECK-V8A-ALLOW-FP-INSTR: #define __ARM_FP16_FORMAT_IEEE 1
22 // CHECK-V8A-ALLOW-FP-INSTR-V8A-NOT: #define __ARM_FEATURE_DOTPROD
23
24 // RUN: %clang -target arm-none-linux-gnueabi -march=armv8.2a+fp16 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FULLFP16-VECTOR-SCALAR %s
25 // CHECK-FULLFP16-VECTOR-SCALAR: #define __ARM_FEATURE_FP16_SCALAR_ARITHMETIC 1
26 // CHECK-FULLFP16-VECTOR-SCALAR: #define __ARM_FEATURE_FP16_VECTOR_ARITHMETIC 1
27 // CHECK-FULLFP16-VECTOR-SCALAR: #define __ARM_FP 0xe
28 // CHECK-FULLFP16-VECTOR-SCALAR: #define __ARM_FP16_FORMAT_IEEE 1
29
30 // RUN: %clang -target arm-none-linux-gnueabi -march=armv8.2a+fp16 -mfpu=vfp4 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FULLFP16-SCALAR %s
31 // CHECK-FULLFP16-SCALAR:       #define __ARM_FEATURE_FP16_SCALAR_ARITHMETIC 1
32 // CHECK-FULLFP16-SCALAR-NOT:   #define __ARM_FEATURE_FP16_VECTOR_ARITHMETIC 1
33 // CHECK-FULLFP16-SCALAR:       #define __ARM_FP 0xe
34 // CHECK-FULLFP16-SCALAR:       #define __ARM_FP16_FORMAT_IEEE 1
35 //
36 // RUN: %clang -target arm-none-linux-gnueabi -march=armv8.2a+dotprod -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-DOTPROD %s
37 // CHECK-DOTPROD: #define __ARM_FEATURE_DOTPROD 1
38
39 // RUN: %clang -target armv8r-none-linux-gnu -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V8R %s
40 // CHECK-V8R: #define __ARMEL__ 1
41 // CHECK-V8R: #define __ARM_ARCH 8
42 // CHECK-V8R: #define __ARM_ARCH_8R__ 1
43 // CHECK-V8R: #define __ARM_FEATURE_CRC32 1
44 // CHECK-V8R: #define __ARM_FEATURE_DIRECTED_ROUNDING 1
45 // CHECK-V8R: #define __ARM_FEATURE_NUMERIC_MAXMIN 1
46 // CHECK-V8R-NOT: #define __ARM_FP 0x
47
48 // RUN: %clang -target armv8r-none-linux-gnueabi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V8R-ALLOW-FP-INSTR %s
49 // RUN: %clang -target armv8r-none-linux-gnueabihf -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V8R-ALLOW-FP-INSTR %s
50 // CHECK-V8R-ALLOW-FP-INSTR: #define __ARMEL__ 1
51 // CHECK-V8R-ALLOW-FP-INSTR: #define __ARM_ARCH 8
52 // CHECK-V8R-ALLOW-FP-INSTR: #define __ARM_ARCH_8R__ 1
53 // CHECK-V8R-ALLOW-FP-INSTR: #define __ARM_FEATURE_CRC32 1
54 // CHECK-V8R-ALLOW-FP-INSTR: #define __ARM_FEATURE_DIRECTED_ROUNDING 1
55 // CHECK-V8R-ALLOW-FP-INSTR: #define __ARM_FEATURE_NUMERIC_MAXMIN 1
56 // CHECK-V8R-ALLOW-FP-INSTR: #define __ARM_FP 0xe
57
58 // RUN: %clang -target armv7a-none-linux-gnu -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V7 %s
59 // CHECK-V7: #define __ARMEL__ 1
60 // CHECK-V7: #define __ARM_ARCH 7
61 // CHECK-V7: #define __ARM_ARCH_7A__ 1
62 // CHECK-V7-NOT: __ARM_FEATURE_CRC32
63 // CHECK-V7-NOT: __ARM_FEATURE_NUMERIC_MAXMIN
64 // CHECK-V7-NOT: __ARM_FEATURE_DIRECTED_ROUNDING
65 // CHECK-V7-NOT: #define __ARM_FP 0x
66
67 // RUN: %clang -target armv7a-none-linux-gnueabi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V7-ALLOW-FP-INSTR %s
68 // RUN: %clang -target armv7a-none-linux-gnueabihf -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V7-ALLOW-FP-INSTR %s
69 // CHECK-V7-ALLOW-FP-INSTR: #define __ARMEL__ 1
70 // CHECK-V7-ALLOW-FP-INSTR: #define __ARM_ARCH 7
71 // CHECK-V7-ALLOW-FP-INSTR: #define __ARM_ARCH_7A__ 1
72 // CHECK-V7-ALLOW-FP-INSTR-NOT: __ARM_FEATURE_CRC32
73 // CHECK-V7-ALLOW-FP-INSTR-NOT: __ARM_FEATURE_NUMERIC_MAXMIN
74 // CHECK-V7-ALLOW-FP-INSTR-NOT: __ARM_FEATURE_DIRECTED_ROUNDING
75 // CHECK-V7-ALLOW-FP-INSTR: #define __ARM_FP 0xc
76
77 // RUN: %clang -target armv7ve-none-linux-gnu -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V7VE %s
78 // CHECK-V7VE: #define __ARMEL__ 1
79 // CHECK-V7VE: #define __ARM_ARCH 7
80 // CHECK-V7VE: #define __ARM_ARCH_7VE__ 1
81 // CHECK-V7VE: #define __ARM_ARCH_EXT_IDIV__ 1
82 // CHECK-V7VE-NOT: #define __ARM_FP 0x
83
84 // RUN: %clang -target armv7ve-none-linux-gnueabi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V7VE-DEFAULT-ABI-SOFT %s
85 // RUN: %clang -target armv7ve-none-linux-gnueabihf -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V7VE-DEFAULT-ABI-SOFT %s
86 // CHECK-V7VE-DEFAULT-ABI-SOFT: #define __ARMEL__ 1
87 // CHECK-V7VE-DEFAULT-ABI-SOFT: #define __ARM_ARCH 7
88 // CHECK-V7VE-DEFAULT-ABI-SOFT: #define __ARM_ARCH_7VE__ 1
89 // CHECK-V7VE-DEFAULT-ABI-SOFT: #define __ARM_ARCH_EXT_IDIV__ 1
90 // CHECK-V7VE-DEFAULT-ABI-SOFT: #define __ARM_FP 0xc
91
92 // RUN: %clang -target x86_64-apple-macosx10.10 -arch armv7s -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V7S %s
93 // CHECK-V7S: #define __ARMEL__ 1
94 // CHECK-V7S: #define __ARM_ARCH 7
95 // CHECK-V7S: #define __ARM_ARCH_7S__ 1
96 // CHECK-V7S-NOT: __ARM_FEATURE_CRC32
97 // CHECK-V7S-NOT: __ARM_FEATURE_NUMERIC_MAXMIN
98 // CHECK-V7S-NOT: __ARM_FEATURE_DIRECTED_ROUNDING
99 // CHECK-V7S: #define __ARM_FP 0xe
100
101 // RUN: %clang -target armv8a -mfloat-abi=hard -x c -E -dM %s | FileCheck -match-full-lines --check-prefix=CHECK-V8-BAREHF %s
102 // CHECK-V8-BAREHF: #define __ARMEL__ 1
103 // CHECK-V8-BAREHF: #define __ARM_ARCH 8
104 // CHECK-V8-BAREHF: #define __ARM_ARCH_8A__ 1
105 // CHECK-V8-BAREHF: #define __ARM_FEATURE_CRC32 1
106 // CHECK-V8-BAREHF: #define __ARM_FEATURE_DIRECTED_ROUNDING 1
107 // CHECK-V8-BAREHF: #define __ARM_FEATURE_NUMERIC_MAXMIN 1
108 // CHECK-V8-BAREHP: #define __ARM_FP 0xe
109 // CHECK-V8-BAREHF: #define __ARM_NEON__ 1
110 // CHECK-V8-BAREHF: #define __ARM_PCS_VFP 1
111 // CHECK-V8-BAREHF: #define __VFP_FP__ 1
112
113 // RUN: %clang -target armv8a -mfloat-abi=hard -mfpu=fp-armv8 -x c -E -dM %s | FileCheck -match-full-lines --check-prefix=CHECK-V8-BAREHF-FP %s
114 // CHECK-V8-BAREHF-FP-NOT: __ARM_NEON__ 1
115 // CHECK-V8-BAREHP-FP: #define __ARM_FP 0xe
116 // CHECK-V8-BAREHF-FP: #define __VFP_FP__ 1
117
118 // RUN: %clang -target armv8a -mfloat-abi=hard -mfpu=neon-fp-armv8 -x c -E -dM %s | FileCheck -match-full-lines --check-prefix=CHECK-V8-BAREHF-NEON-FP %s
119 // RUN: %clang -target armv8a -mfloat-abi=hard -mfpu=crypto-neon-fp-armv8 -x c -E -dM %s | FileCheck -match-full-lines --check-prefix=CHECK-V8-BAREHF-NEON-FP %s
120 // CHECK-V8-BAREHP-NEON-FP: #define __ARM_FP 0xe
121 // CHECK-V8-BAREHF-NEON-FP: #define __ARM_NEON__ 1
122 // CHECK-V8-BAREHF-NEON-FP: #define __VFP_FP__ 1
123
124 // RUN: %clang -target armv8a -mnocrc -x c -E -dM %s | FileCheck -match-full-lines --check-prefix=CHECK-V8-NOCRC %s
125 // CHECK-V8-NOCRC-NOT: __ARM_FEATURE_CRC32 1
126
127 // Check that -mhwdiv works properly for armv8/thumbv8 (enabled by default).
128
129 // RUN: %clang -target armv8 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8 %s
130 // RUN: %clang -target armv8 -mthumb -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8 %s
131 // RUN: %clang -target armv8-eabi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8 %s
132 // RUN: %clang -target armv8-eabi -mthumb -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8 %s
133 // V8:#define __ARM_ARCH_EXT_IDIV__ 1
134
135 // RUN: %clang -target armv8 -mhwdiv=none -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NOHWDIV-V8 %s
136 // RUN: %clang -target armv8 -mthumb -mhwdiv=none -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NOHWDIV-V8 %s
137 // RUN: %clang -target armv8 -mhwdiv=thumb -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NOHWDIV-V8 %s
138 // RUN: %clang -target armv8 -mthumb -mhwdiv=arm -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NOHWDIV-V8 %s
139 // NOHWDIV-V8-NOT:#define __ARM_ARCH_EXT_IDIV__
140
141 // RUN: %clang -target armv8a -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8A %s
142 // RUN: %clang -target armv8a -mthumb -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8A %s
143 // V8A:#define __ARM_ARCH_EXT_IDIV__ 1
144 // V8A-NOT:#define __ARM_FP 0x
145
146 // RUN: %clang -target armv8a-eabi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8A-ALLOW-FP-INSTR %s
147 // RUN: %clang -target armv8a-eabi -mthumb -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8A-ALLOW-FP-INSTR %s
148 // RUN: %clang -target armv8a-eabihf -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8A-ALLOW-FP-INSTR %s
149 // RUN: %clang -target armv8a-eabihf -mthumb -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8A-ALLOW-FP-INSTR %s
150 // V8A-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1
151 // V8A-ALLOW-FP-INSTR:#define __ARM_FP 0xe
152
153 // RUN: %clang -target armv8m.base-none-linux-gnu -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8M_BASELINE %s
154 // V8M_BASELINE: #define __ARM_ARCH 8
155 // V8M_BASELINE: #define __ARM_ARCH_8M_BASE__ 1
156 // V8M_BASELINE: #define __ARM_ARCH_EXT_IDIV__ 1
157 // V8M_BASELINE-NOT: __ARM_ARCH_ISA_ARM
158 // V8M_BASELINE: #define __ARM_ARCH_ISA_THUMB 1
159 // V8M_BASELINE: #define __ARM_ARCH_PROFILE 'M'
160 // V8M_BASELINE-NOT: __ARM_FEATURE_CRC32
161 // V8M_BASELINE-NOT: __ARM_FEATURE_DSP
162 // V8M_BASELINE-NOT: __ARM_FP 0x{{.*}}
163 // V8M_BASELINE-NOT: __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1
164
165 // RUN: %clang -target armv8m.main-none-linux-gnu -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8M_MAINLINE %s
166 // V8M_MAINLINE: #define __ARM_ARCH 8
167 // V8M_MAINLINE: #define __ARM_ARCH_8M_MAIN__ 1
168 // V8M_MAINLINE: #define __ARM_ARCH_EXT_IDIV__ 1
169 // V8M_MAINLINE-NOT: __ARM_ARCH_ISA_ARM
170 // V8M_MAINLINE: #define __ARM_ARCH_ISA_THUMB 2
171 // V8M_MAINLINE: #define __ARM_ARCH_PROFILE 'M'
172 // V8M_MAINLINE-NOT: __ARM_FEATURE_CRC32
173 // V8M_MAINLINE-NOT: __ARM_FEATURE_DSP
174 // V8M_MAINLINE-NOT: #define __ARM_FP 0x
175 // V8M_MAINLINE: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
176
177 // RUN: %clang -target armv8m.main-none-linux-gnueabi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8M-MAINLINE-ALLOW-FP-INSTR %s
178 // RUN: %clang -target armv8m.main-none-linux-gnueabihf -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8M-MAINLINE-ALLOW-FP-INSTR %s
179 // V8M-MAINLINE-ALLOW-FP-INSTR: #define __ARM_ARCH 8
180 // V8M-MAINLINE-ALLOW-FP-INSTR: #define __ARM_ARCH_8M_MAIN__ 1
181 // V8M-MAINLINE-ALLOW-FP-INSTR: #define __ARM_ARCH_EXT_IDIV__ 1
182 // V8M-MAINLINE-ALLOW-FP-INSTR-NOT: __ARM_ARCH_ISA_ARM
183 // V8M-MAINLINE-ALLOW-FP-INSTR: #define __ARM_ARCH_ISA_THUMB 2
184 // V8M-MAINLINE-ALLOW-FP-INSTR: #define __ARM_ARCH_PROFILE 'M'
185 // V8M-MAINLINE-ALLOW-FP-INSTR-NOT: __ARM_FEATURE_CRC32
186 // V8M-MAINLINE-ALLOW-FP-INSTR-NOT: __ARM_FEATURE_DSP
187 // V8M-MAINLINE-ALLOW-FP-INSTR: #define __ARM_FP 0xe
188 // V8M-MAINLINE-ALLOW-FP-INSTR: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
189
190 // RUN: %clang -target arm-none-linux-gnu -march=armv8-m.main+dsp -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8M_MAINLINE_DSP %s
191 // V8M_MAINLINE_DSP: #define __ARM_ARCH 8
192 // V8M_MAINLINE_DSP: #define __ARM_ARCH_8M_MAIN__ 1
193 // V8M_MAINLINE_DSP: #define __ARM_ARCH_EXT_IDIV__ 1
194 // V8M_MAINLINE_DSP-NOT: __ARM_ARCH_ISA_ARM
195 // V8M_MAINLINE_DSP: #define __ARM_ARCH_ISA_THUMB 2
196 // V8M_MAINLINE_DSP: #define __ARM_ARCH_PROFILE 'M'
197 // V8M_MAINLINE_DSP-NOT: __ARM_FEATURE_CRC32
198 // V8M_MAINLINE_DSP: #define __ARM_FEATURE_DSP 1
199 // V8M_MAINLINE_DSP-NOT: #define __ARM_FP 0x
200 // V8M_MAINLINE_DSP: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
201
202 // RUN: %clang -target arm-none-linux-gnueabi -march=armv8-m.main+dsp -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8M-MAINLINE-DSP-ALLOW-FP-INSTR %s
203 // V8M-MAINLINE-DSP-ALLOW-FP-INSTR: #define __ARM_ARCH 8
204 // V8M-MAINLINE-DSP-ALLOW-FP-INSTR: #define __ARM_ARCH_8M_MAIN__ 1
205 // V8M-MAINLINE-DSP-ALLOW-FP-INSTR: #define __ARM_ARCH_EXT_IDIV__ 1
206 // V8M-MAINLINE-DSP-ALLOW-FP-INSTR-NOT: __ARM_ARCH_ISA_ARM
207 // V8M-MAINLINE-DSP-ALLOW-FP-INSTR: #define __ARM_ARCH_ISA_THUMB 2
208 // V8M-MAINLINE-DSP-ALLOW-FP-INSTR: #define __ARM_ARCH_PROFILE 'M'
209 // V8M-MAINLINE-DSP-ALLOW-FP-INSTR-NOT: __ARM_FEATURE_CRC32
210 // V8M-MAINLINE-DSP-ALLOW-FP-INSTR: #define __ARM_FEATURE_DSP 1
211 // V8M-MAINLINE-DSP-ALLOW-FP-INSTR: #define __ARM_FP 0xe
212 // V8M-MAINLINE-DSP-ALLOW-FP-INSTR: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
213
214 // RUN: %clang -target arm-none-linux-gnu -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-DEFS %s
215 // CHECK-DEFS:#define __ARM_PCS 1
216 // CHECK-DEFS:#define __ARM_SIZEOF_MINIMAL_ENUM 4
217 // CHECK-DEFS:#define __ARM_SIZEOF_WCHAR_T 4
218
219 // RUN: %clang -target arm-none-linux-gnu -fno-math-errno -fno-signed-zeros\
220 // RUN:        -fno-trapping-math -fassociative-math -freciprocal-math\
221 // RUN:        -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FASTMATH %s
222 // RUN: %clang -target arm-none-linux-gnu -ffast-math -x c -E -dM %s -o -\
223 // RUN:        | FileCheck -match-full-lines --check-prefix=CHECK-FASTMATH %s
224 // CHECK-FASTMATH: #define __ARM_FP_FAST 1
225
226 // RUN: %clang -target arm-none-linux-gnu -fshort-wchar -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-SHORTWCHAR %s
227 // CHECK-SHORTWCHAR:#define __ARM_SIZEOF_WCHAR_T 2
228
229 // RUN: %clang -target arm-none-linux-gnu -fshort-enums -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-SHORTENUMS %s
230 // CHECK-SHORTENUMS:#define __ARM_SIZEOF_MINIMAL_ENUM 1
231
232 // Test that -mhwdiv has the right effect for a target CPU which has hwdiv enabled by default.
233 // RUN: %clang -target armv7 -mcpu=cortex-a15 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=HWDIV %s
234 // RUN: %clang -target armv7 -mthumb -mcpu=cortex-a15 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=HWDIV %s
235 // RUN: %clang -target armv7 -mcpu=cortex-a15 -mhwdiv=arm -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=HWDIV %s
236 // RUN: %clang -target armv7 -mthumb -mcpu=cortex-a15 -mhwdiv=thumb -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=HWDIV %s
237 // HWDIV:#define __ARM_ARCH_EXT_IDIV__ 1
238
239 // RUN: %clang -target arm -mcpu=cortex-a15 -mhwdiv=thumb -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NOHWDIV %s
240 // RUN: %clang -target arm -mthumb -mcpu=cortex-a15 -mhwdiv=arm -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NOHWDIV %s
241 // RUN: %clang -target arm -mcpu=cortex-a15 -mhwdiv=none -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NOHWDIV %s
242 // RUN: %clang -target arm -mthumb -mcpu=cortex-a15 -mhwdiv=none -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NOHWDIV %s
243 // NOHWDIV-NOT:#define __ARM_ARCH_EXT_IDIV__
244
245
246 // Check that -mfpu works properly for Cortex-A7 (enabled by default).
247 // RUN: %clang -target armv7-none-linux-gnueabi -mcpu=cortex-a7 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=DEFAULTFPU-A7 %s
248 // RUN: %clang -target armv7-none-linux-gnueabi -mthumb -mcpu=cortex-a7 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=DEFAULTFPU-A7 %s
249 // RUN: %clang -target armv7-none-linux-gnueabihf -mcpu=cortex-a7 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=DEFAULTFPU-A7 %s
250 // RUN: %clang -target armv7-none-linux-gnueabihf -mthumb -mcpu=cortex-a7 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=DEFAULTFPU-A7 %s
251 // DEFAULTFPU-A7:#define __ARM_FP 0xe
252 // DEFAULTFPU-A7:#define __ARM_NEON__ 1
253 // DEFAULTFPU-A7:#define __ARM_VFPV4__ 1
254
255 // RUN: %clang -target armv7-none-linux-gnueabi -mcpu=cortex-a7 -mfpu=none -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=FPUNONE-A7 %s
256 // RUN: %clang -target armv7-none-linux-gnueabi -mthumb -mcpu=cortex-a7 -mfpu=none -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=FPUNONE-A7 %s
257 // FPUNONE-A7-NOT:#define __ARM_FP 0x{{.*}}
258 // FPUNONE-A7-NOT:#define __ARM_NEON__ 1
259 // FPUNONE-A7-NOT:#define __ARM_VFPV4__ 1
260
261 // RUN: %clang -target armv7-none-linux-gnueabi -mcpu=cortex-a7 -mfpu=vfp4 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NONEON-A7 %s
262 // RUN: %clang -target armv7-none-linux-gnueabi -mthumb -mcpu=cortex-a7 -mfpu=vfp4 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NONEON-A7 %s
263 // NONEON-A7:#define __ARM_FP 0xe
264 // NONEON-A7-NOT:#define __ARM_NEON__ 1
265 // NONEON-A7:#define __ARM_VFPV4__ 1
266
267 // Check that -mfpu works properly for Cortex-A5 (enabled by default).
268 // RUN: %clang -target armv7-none-linux-gnueabi -mcpu=cortex-a5 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=DEFAULTFPU-A5 %s
269 // RUN: %clang -target armv7-none-linux-gnueabi -mthumb -mcpu=cortex-a5 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=DEFAULTFPU-A5 %s
270 // DEFAULTFPU-A5:#define __ARM_FP 0xe
271 // DEFAULTFPU-A5:#define __ARM_NEON__ 1
272 // DEFAULTFPU-A5:#define __ARM_VFPV4__ 1
273
274 // RUN: %clang -target armv7-none-linux-gnueabi -mcpu=cortex-a5 -mfpu=none -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=FPUNONE-A5 %s
275 // RUN: %clang -target armv7-none-linux-gnueabi -mthumb -mcpu=cortex-a5 -mfpu=none -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=FPUNONE-A5 %s
276 // FPUNONE-A5-NOT:#define __ARM_FP 0x{{.*}}
277 // FPUNONE-A5-NOT:#define __ARM_NEON__ 1
278 // FPUNONE-A5-NOT:#define __ARM_VFPV4__ 1
279
280 // RUN: %clang -target armv7-none-linux-gnueabi -mcpu=cortex-a5 -mfpu=vfp4-d16 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NONEON-A5 %s
281 // RUN: %clang -target armv7-none-linux-gnueabi -mthumb -mcpu=cortex-a5 -mfpu=vfp4-d16 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NONEON-A5 %s
282 // NONEON-A5:#define __ARM_FP 0xe
283 // NONEON-A5-NOT:#define __ARM_NEON__ 1
284 // NONEON-A5:#define __ARM_VFPV4__ 1
285
286 // FIXME: add check for further predefines
287 // Test whether predefines are as expected when targeting ep9312.
288 // RUN: %clang -target armv4t -mcpu=ep9312 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A4T %s
289 // A4T-NOT:#define __ARM_FEATURE_DSP
290 // A4T-NOT:#define __ARM_FP 0x{{.*}}
291
292 // Test whether predefines are as expected when targeting arm10tdmi.
293 // RUN: %clang -target armv5 -mcpu=arm10tdmi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A5T %s
294 // A5T-NOT:#define __ARM_FEATURE_DSP
295 // A5T-NOT:#define __ARM_FP 0x{{.*}}
296
297 // Test whether predefines are as expected when targeting cortex-a5i (soft FP ABI as default).
298 // RUN: %clang -target armv7 -mcpu=cortex-a5 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A5 %s
299 // RUN: %clang -target armv7 -mthumb -mcpu=cortex-a5 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A5 %s
300 // A5:#define __ARM_ARCH 7
301 // A5:#define __ARM_ARCH_7A__ 1
302 // A5-NOT:#define __ARM_ARCH_EXT_IDIV__
303 // A5:#define __ARM_ARCH_PROFILE 'A'
304 // A5-NOT:#define __ARM_DWARF_EH__ 1
305 // A5-NOT: #define __ARM_FEATURE_DIRECTED_ROUNDING
306 // A5:#define __ARM_FEATURE_DSP 1
307 // A5-NOT: #define __ARM_FEATURE_NUMERIC_MAXMIN
308 // A5-NOT:#define __ARM_FP 0x
309
310 // Test whether predefines are as expected when targeting cortex-a5 (softfp FP ABI as default).
311 // RUN: %clang -target armv7-eabi -mcpu=cortex-a5 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A5-ALLOW-FP-INSTR %s
312 // RUN: %clang -target armv7-eabi -mthumb -mcpu=cortex-a5 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A5-ALLOW-FP-INSTR %s
313 // A5-ALLOW-FP-INSTR:#define __ARM_ARCH 7
314 // A5-ALLOW-FP-INSTR:#define __ARM_ARCH_7A__ 1
315 // A5-ALLOW-FP-INSTR-NOT:#define __ARM_ARCH_EXT_IDIV__
316 // A5-ALLOW-FP-INSTR:#define __ARM_ARCH_PROFILE 'A'
317 // A5-ALLOW-FP-INSTR-NOT: #define __ARM_FEATURE_DIRECTED_ROUNDING
318 // A5-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
319 // A5-ALLOW-FP-INSTR-NOT: #define __ARM_FEATURE_NUMERIC_MAXMIN
320 // A5-ALLOW-FP-INSTR:#define __ARM_FP 0xe
321
322 // Test whether predefines are as expected when targeting cortex-a7 (soft FP ABI as default).
323 // RUN: %clang -target armv7k -mcpu=cortex-a7 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A7 %s
324 // RUN: %clang -target armv7k -mthumb -mcpu=cortex-a7 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A7 %s
325 // A7:#define __ARM_ARCH 7
326 // A7:#define __ARM_ARCH_EXT_IDIV__ 1
327 // A7:#define __ARM_ARCH_PROFILE 'A'
328 // A7-NOT:#define __ARM_DWARF_EH__ 1
329 // A7:#define __ARM_FEATURE_DSP 1
330 // A7-NOT:#define __ARM_FP 0x
331
332 // Test whether predefines are as expected when targeting cortex-a7 (softfp FP ABI as default).
333 // RUN: %clang -target armv7k-eabi -mcpu=cortex-a7 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A7-ALLOW-FP-INSTR %s
334 // RUN: %clang -target armv7k-eabi -mthumb -mcpu=cortex-a7 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A7-ALLOW-FP-INSTR %s
335 // A7-ALLOW-FP-INSTR:#define __ARM_ARCH 7
336 // A7-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1
337 // A7-ALLOW-FP-INSTR:#define __ARM_ARCH_PROFILE 'A'
338 // A7-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
339 // A7-ALLOW-FP-INSTR:#define __ARM_FP 0xe
340
341 // Test whether predefines are as expected when targeting cortex-a7.
342 // RUN: %clang -target x86_64-apple-darwin -arch armv7k -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV7K %s
343 // ARMV7K:#define __ARM_ARCH 7
344 // ARMV7K:#define __ARM_ARCH_EXT_IDIV__ 1
345 // ARMV7K:#define __ARM_ARCH_PROFILE 'A'
346 // ARMV7K:#define __ARM_DWARF_EH__ 1
347 // ARMV7K:#define __ARM_FEATURE_DSP 1
348 // ARMV7K:#define __ARM_FP 0xe
349 // ARMV7K:#define __ARM_PCS_VFP 1
350
351
352 // Test whether predefines are as expected when targeting cortex-a8 (soft FP ABI as default).
353 // RUN: %clang -target armv7 -mcpu=cortex-a8 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A8 %s
354 // RUN: %clang -target armv7 -mthumb -mcpu=cortex-a8 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A8 %s
355 // A8-NOT:#define __ARM_ARCH_EXT_IDIV__
356 // A8:#define __ARM_FEATURE_DSP 1
357 // A8-NOT:#define __ARM_FP 0x
358
359 // Test whether predefines are as expected when targeting cortex-a8 (softfp FP ABI as default).
360 // RUN: %clang -target armv7-eabi -mcpu=cortex-a8 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A8-ALLOW-FP-INSTR %s
361 // RUN: %clang -target armv7-eabi -mthumb -mcpu=cortex-a8 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A8-ALLOW-FP-INSTR %s
362 // A8-ALLOW-FP-INSTR-NOT:#define __ARM_ARCH_EXT_IDIV__
363 // A8-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
364 // A8-ALLOW-FP-INSTR:#define __ARM_FP 0xc
365
366 // Test whether predefines are as expected when targeting cortex-a9 (soft FP as default).
367 // RUN: %clang -target armv7 -mcpu=cortex-a9 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A9 %s
368 // RUN: %clang -target armv7 -mthumb -mcpu=cortex-a9 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A9 %s
369 // A9-NOT:#define __ARM_ARCH_EXT_IDIV__
370 // A9:#define __ARM_FEATURE_DSP 1
371 // A9-NOT:#define __ARM_FP 0x
372
373 // Test whether predefines are as expected when targeting cortex-a9 (softfp FP as default).
374 // RUN: %clang -target armv7-eabi -mcpu=cortex-a9 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A9-ALLOW-FP-INSTR %s
375 // RUN: %clang -target armv7-eabi -mthumb -mcpu=cortex-a9 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A9-ALLOW-FP-INSTR %s
376 // A9-ALLOW-FP-INSTR-NOT:#define __ARM_ARCH_EXT_IDIV__
377 // A9-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
378 // A9-ALLOW-FP-INSTR:#define __ARM_FP 0xe
379
380
381 // Check that -mfpu works properly for Cortex-A12 (enabled by default).
382 // RUN: %clang -target armv7-none-linux-gnueabi -mcpu=cortex-a12 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=DEFAULTFPU-A12 %s
383 // RUN: %clang -target armv7-none-linux-gnueabi -mthumb -mcpu=cortex-a12 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=DEFAULTFPU-A12 %s
384 // DEFAULTFPU-A12:#define __ARM_FP 0xe
385 // DEFAULTFPU-A12:#define __ARM_NEON__ 1
386 // DEFAULTFPU-A12:#define __ARM_VFPV4__ 1
387
388 // RUN: %clang -target armv7-none-linux-gnueabi -mcpu=cortex-a12 -mfpu=none -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=FPUNONE-A12 %s
389 // RUN: %clang -target armv7-none-linux-gnueabi -mthumb -mcpu=cortex-a12 -mfpu=none -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=FPUNONE-A12 %s
390 // FPUNONE-A12-NOT:#define __ARM_FP 0x{{.*}}
391 // FPUNONE-A12-NOT:#define __ARM_NEON__ 1
392 // FPUNONE-A12-NOT:#define __ARM_VFPV4__ 1
393
394 // Test whether predefines are as expected when targeting cortex-a12 (soft FP ABI as default).
395 // RUN: %clang -target armv7 -mcpu=cortex-a12 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A12 %s
396 // RUN: %clang -target armv7 -mthumb -mcpu=cortex-a12 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A12 %s
397 // A12:#define __ARM_ARCH 7
398 // A12:#define __ARM_ARCH_7A__ 1
399 // A12:#define __ARM_ARCH_EXT_IDIV__ 1
400 // A12:#define __ARM_ARCH_PROFILE 'A'
401 // A12:#define __ARM_FEATURE_DSP 1
402 // A12-NOT:#define __ARM_FP 0x
403
404 // Test whether predefines are as expected when targeting cortex-a12 (soft FP ABI as default).
405 // RUN: %clang -target armv7-eabi -mcpu=cortex-a12 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A12-ALLOW-FP-INSTR %s
406 // RUN: %clang -target armv7-eabi -mthumb -mcpu=cortex-a12 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A12-ALLOW-FP-INSTR %s
407 // A12-ALLOW-FP-INSTR:#define __ARM_ARCH 7
408 // A12-ALLOW-FP-INSTR:#define __ARM_ARCH_7A__ 1
409 // A12-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1
410 // A12-ALLOW-FP-INSTR:#define __ARM_ARCH_PROFILE 'A'
411 // A12-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
412 // A12-ALLOW-FP-INSTR:#define __ARM_FP 0xe
413
414 // Test whether predefines are as expected when targeting cortex-a15 (soft FP ABI as default).
415 // RUN: %clang -target armv7 -mcpu=cortex-a15 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A15 %s
416 // RUN: %clang -target armv7 -mthumb -mcpu=cortex-a15 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A15 %s
417 // A15:#define __ARM_ARCH_EXT_IDIV__ 1
418 // A15:#define __ARM_FEATURE_DSP 1
419 // A15-NOT:#define __ARM_FP 0x
420
421 // Test whether predefines are as expected when targeting cortex-a15 (softfp ABI as default).
422 // RUN: %clang -target armv7-eabi -mcpu=cortex-a15 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A15-ALLOW-FP-INSTR %s
423 // RUN: %clang -target armv7-eabi -mthumb -mcpu=cortex-a15 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A15-ALLOW-FP-INSTR %s
424 // A15-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1
425 // A15-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
426 // A15-ALLOW-FP-INSTR:#define __ARM_FP 0xe
427
428 // Check that -mfpu works properly for Cortex-A17 (enabled by default).
429 // RUN: %clang -target armv7-none-linux-gnueabi -mcpu=cortex-a17 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=DEFAULTFPU-A17 %s
430 // RUN: %clang -target armv7-none-linux-gnueabi -mthumb -mcpu=cortex-a17 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=DEFAULTFPU-A17 %s
431 // DEFAULTFPU-A17:#define __ARM_FP 0xe
432 // DEFAULTFPU-A17:#define __ARM_NEON__ 1
433 // DEFAULTFPU-A17:#define __ARM_VFPV4__ 1
434
435 // RUN: %clang -target armv7-none-linux-gnueabi -mcpu=cortex-a17 -mfpu=none -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=FPUNONE-A17 %s
436 // RUN: %clang -target armv7-none-linux-gnueabi -mthumb -mcpu=cortex-a17 -mfpu=none -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=FPUNONE-A17 %s
437 // FPUNONE-A17-NOT:#define __ARM_FP 0x{{.*}}
438 // FPUNONE-A17-NOT:#define __ARM_NEON__ 1
439 // FPUNONE-A17-NOT:#define __ARM_VFPV4__ 1
440
441 // Test whether predefines are as expected when targeting cortex-a17 (soft FP ABI as default).
442 // RUN: %clang -target armv7 -mcpu=cortex-a17 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A17 %s
443 // RUN: %clang -target armv7 -mthumb -mcpu=cortex-a17 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A17 %s
444 // A17:#define __ARM_ARCH 7
445 // A17:#define __ARM_ARCH_7A__ 1
446 // A17:#define __ARM_ARCH_EXT_IDIV__ 1
447 // A17:#define __ARM_ARCH_PROFILE 'A'
448 // A17:#define __ARM_FEATURE_DSP 1
449 // A17-NOT:#define __ARM_FP 0x
450
451 // Test whether predefines are as expected when targeting cortex-a17 (softfp FP ABI as default).
452 // RUN: %clang -target armv7-eabi -mcpu=cortex-a17 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A17-ALLOW-FP-INSTR %s
453 // RUN: %clang -target armv7-eabi -mthumb -mcpu=cortex-a17 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A17-ALLOW-FP-INSTR %s
454 // A17-ALLOW-FP-INSTR:#define __ARM_ARCH 7
455 // A17-ALLOW-FP-INSTR:#define __ARM_ARCH_7A__ 1
456 // A17-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1
457 // A17-ALLOW-FP-INSTR:#define __ARM_ARCH_PROFILE 'A'
458 // A17-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
459 // A17-ALLOW-FP-INSTR:#define __ARM_FP 0xe
460
461 // Test whether predefines are as expected when targeting swift (soft FP ABI as default).
462 // RUN: %clang -target armv7s -mcpu=swift -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=SWIFT %s
463 // RUN: %clang -target armv7s -mthumb -mcpu=swift -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=SWIFT %s
464 // SWIFT:#define __ARM_ARCH_EXT_IDIV__ 1
465 // SWIFT:#define __ARM_FEATURE_DSP 1
466 // SWIFT-NOT:#define __ARM_FP 0xxE
467
468 // Test whether predefines are as expected when targeting swift (softfp FP ABI as default).
469 // RUN: %clang -target armv7s-eabi -mcpu=swift -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=SWIFT-ALLOW-FP-INSTR %s
470 // RUN: %clang -target armv7s-eabi -mthumb -mcpu=swift -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=SWIFT-ALLOW-FP-INSTR %s
471 // SWIFT-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1
472 // SWIFT-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
473 // SWIFT-ALLOW-FP-INSTR:#define __ARM_FP 0xe
474
475 // Test whether predefines are as expected when targeting ARMv8-A Cortex implementations (soft FP ABI as default)
476 // RUN: %clang -target armv8 -mcpu=cortex-a32 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
477 // RUN: %clang -target armv8 -mthumb -mcpu=cortex-a32 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
478 // RUN: %clang -target armv8 -mcpu=cortex-a35 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
479 // RUN: %clang -target armv8 -mthumb -mcpu=cortex-a35 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
480 // RUN: %clang -target armv8 -mcpu=cortex-a53 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
481 // RUN: %clang -target armv8 -mthumb -mcpu=cortex-a53 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
482 // RUN: %clang -target armv8 -mcpu=cortex-a57 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
483 // RUN: %clang -target armv8 -mthumb -mcpu=cortex-a57 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
484 // RUN: %clang -target armv8 -mcpu=cortex-a72 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
485 // RUN: %clang -target armv8 -mthumb -mcpu=cortex-a72 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
486 // RUN: %clang -target armv8 -mcpu=cortex-a73 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
487 // RUN: %clang -target armv8 -mthumb -mcpu=cortex-a73 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
488 //
489 // RUN: %clang -target armv8 -mcpu=exynos-m1 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
490 // RUN: %clang -target armv8 -mthumb -mcpu=exynos-m1 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
491 // RUN: %clang -target armv8 -mcpu=exynos-m2 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
492 // RUN: %clang -target armv8 -mthumb -mcpu=exynos-m2 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
493 // RUN: %clang -target armv8 -mcpu=exynos-m3 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
494 // RUN: %clang -target armv8 -mthumb -mcpu=exynos-m3 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
495 // RUN: %clang -target armv8 -mcpu=exynos-m4 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
496 // RUN: %clang -target armv8 -mthumb -mcpu=exynos-m4 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
497 // ARMV8:#define __ARM_ARCH_EXT_IDIV__ 1
498 // ARMV8:#define __ARM_FEATURE_DSP 1
499 // ARMV8-NOT:#define __ARM_FP 0x
500
501 // Test whether predefines are as expected when targeting ARMv8-A Cortex implementations (softfp FP ABI as default)
502 // RUN: %clang -target armv8-eabi -mcpu=cortex-a32 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8-ALLOW-FP-INSTR %s
503 // RUN: %clang -target armv8-eabi -mthumb -mcpu=cortex-a32 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8-ALLOW-FP-INSTR %s
504 // RUN: %clang -target armv8-eabi -mcpu=cortex-a35 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8-ALLOW-FP-INSTR %s
505 // RUN: %clang -target armv8-eabi -mthumb -mcpu=cortex-a35 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8-ALLOW-FP-INSTR %s
506 // RUN: %clang -target armv8-eabi -mcpu=cortex-a53 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8-ALLOW-FP-INSTR %s
507 // RUN: %clang -target armv8-eabi -mthumb -mcpu=cortex-a53 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8-ALLOW-FP-INSTR %s
508 // RUN: %clang -target armv8-eabi -mcpu=cortex-a57 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8-ALLOW-FP-INSTR %s
509 // RUN: %clang -target armv8-eabi -mthumb -mcpu=cortex-a57 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8-ALLOW-FP-INSTR %s
510 // RUN: %clang -target armv8-eabi -mcpu=cortex-a72 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8-ALLOW-FP-INSTR %s
511 // RUN: %clang -target armv8-eabi -mthumb -mcpu=cortex-a72 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8-ALLOW-FP-INSTR %s
512 // RUN: %clang -target armv8-eabi -mcpu=cortex-a73 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8-ALLOW-FP-INSTR %s
513 // RUN: %clang -target armv8-eabi -mthumb -mcpu=cortex-a73 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8-ALLOW-FP-INSTR %s
514 //
515 // RUN: %clang -target armv8-eabi -mcpu=exynos-m1 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8-ALLOW-FP-INSTR %s
516 // RUN: %clang -target armv8-eabi -mthumb -mcpu=exynos-m1 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8-ALLOW-FP-INSTR %s
517 // RUN: %clang -target armv8-eabi -mcpu=exynos-m2 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8-ALLOW-FP-INSTR %s
518 // RUN: %clang -target armv8-eabi -mthumb -mcpu=exynos-m2 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8-ALLOW-FP-INSTR %s
519 // RUN: %clang -target armv8-eabi -mcpu=exynos-m3 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8-ALLOW-FP-INSTR %s
520 // RUN: %clang -target armv8-eabi -mthumb -mcpu=exynos-m3 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8-ALLOW-FP-INSTR %s
521 // RUN: %clang -target armv8-eabi -mcpu=exynos-m4 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8-ALLOW-FP-INSTR %s
522 // RUN: %clang -target armv8-eabi -mthumb -mcpu=exynos-m4 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8-ALLOW-FP-INSTR %s
523 // ARMV8-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1
524 // ARMV8-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
525 // ARMV8-ALLOW-FP-INSTR:#define __ARM_FP 0xe
526
527 // Test whether predefines are as expected when targeting cortex-r4.
528 // RUN: %clang -target armv7 -mcpu=cortex-r4 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R4-ARM %s
529 // R4-ARM-NOT:#define __ARM_ARCH_EXT_IDIV__
530 // R4-ARM:#define __ARM_FEATURE_DSP 1
531 // R4-ARM-NOT:#define __ARM_FP 0x{{.*}}
532
533 // RUN: %clang -target armv7 -mthumb -mcpu=cortex-r4 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R4-THUMB %s
534 // R4-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
535 // R4-THUMB:#define __ARM_FEATURE_DSP 1
536 // R4-THUMB-NOT:#define __ARM_FP 0x{{.*}}
537
538 // Test whether predefines are as expected when targeting cortex-r4f (soft FP ABI as default).
539 // RUN: %clang -target armv7 -mcpu=cortex-r4f -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R4F-ARM %s
540 // R4F-ARM-NOT:#define __ARM_ARCH_EXT_IDIV__
541 // R4F-ARM:#define __ARM_FEATURE_DSP 1
542 // R4F-ARM-NOT:#define __ARM_FP 0x
543
544 // Test whether predefines are as expected when targeting cortex-r4f (softfp FP ABI as default).
545 // RUN: %clang -target armv7-eabi -mcpu=cortex-r4f -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R4F-ARM-ALLOW-FP-INSTR %s
546 // R4F-ARM-ALLOW-FP-INSTR-NOT:#define __ARM_ARCH_EXT_IDIV__
547 // R4F-ARM-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
548 // R4F-ARM-ALLOW-FP-INSTR:#define __ARM_FP 0xc
549
550 // RUN: %clang -target armv7 -mthumb -mcpu=cortex-r4f -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R4F-THUMB %s
551 // R4F-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
552 // R4F-THUMB:#define __ARM_FEATURE_DSP 1
553 // R4F-THUMB-NOT:#define __ARM_FP 0x
554
555 // RUN: %clang -target armv7-eabi -mthumb -mcpu=cortex-r4f -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R4F-THUMB-ALLOW-FP-INSTR %s
556 // R4F-THUMB-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1
557 // R4F-THUMB-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
558 // R4F-THUMB-ALLOW-FP-INSTR:#define __ARM_FP 0xc
559
560 // Test whether predefines are as expected when targeting cortex-r5 (soft FP ABI as default).
561 // RUN: %clang -target armv7 -mcpu=cortex-r5 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R5 %s
562 // RUN: %clang -target armv7 -mthumb -mcpu=cortex-r5 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R5 %s
563 // R5:#define __ARM_ARCH_EXT_IDIV__ 1
564 // R5:#define __ARM_FEATURE_DSP 1
565 // R5-NOT:#define __ARM_FP 0x
566
567 // Test whether predefines are as expected when targeting cortex-r5 (softfp FP ABI as default).
568 // RUN: %clang -target armv7-eabi -mcpu=cortex-r5 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R5-ALLOW-FP-INSTR %s
569 // RUN: %clang -target armv7-eabi -mthumb -mcpu=cortex-r5 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R5-ALLOW-FP-INSTR %s
570 // R5-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1
571 // R5-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
572 // R5-ALLOW-FP-INSTR:#define __ARM_FP 0xc
573
574 // Test whether predefines are as expected when targeting cortex-r7 and cortex-r8 (soft FP ABI as default).
575 // RUN: %clang -target armv7 -mcpu=cortex-r7 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R7-R8 %s
576 // RUN: %clang -target armv7 -mthumb -mcpu=cortex-r7 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R7-R8 %s
577 // RUN: %clang -target armv7 -mcpu=cortex-r8 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R7-R8 %s
578 // RUN: %clang -target armv7 -mthumb -mcpu=cortex-r8 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R7-R8 %s
579 // R7-R8:#define __ARM_ARCH_EXT_IDIV__ 1
580 // R7-R8:#define __ARM_FEATURE_DSP 1
581 // R7-R8-NOT:#define __ARM_FP 0x
582
583 // Test whether predefines are as expected when targeting cortex-r7 and cortex-r8 (softfp FP ABI as default).
584 // RUN: %clang -target armv7-eabi -mcpu=cortex-r7 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R7-R8-ALLOW-FP-INSTR %s
585 // RUN: %clang -target armv7-eabi -mthumb -mcpu=cortex-r7 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R7-R8-ALLOW-FP-INSTR %s
586 // RUN: %clang -target armv7-eabi -mcpu=cortex-r8 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R7-R8-ALLOW-FP-INSTR %s
587 // RUN: %clang -target armv7-eabi -mthumb -mcpu=cortex-r8 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R7-R8-ALLOW-FP-INSTR %s
588 // R7-R8-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1
589 // R7-R8-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
590 // R7-R8-ALLOW-FP-INSTR:#define __ARM_FP 0xe
591
592 // Test whether predefines are as expected when targeting cortex-m0.
593 // RUN: %clang -target armv7 -mthumb -mcpu=cortex-m0 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M0-THUMB %s
594 // RUN: %clang -target armv7 -mthumb -mcpu=cortex-m0plus -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M0-THUMB %s
595 // RUN: %clang -target armv7 -mthumb -mcpu=cortex-m1 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M0-THUMB %s
596 // RUN: %clang -target armv7 -mthumb -mcpu=sc000 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M0-THUMB %s
597 // M0-THUMB-NOT:#define __ARM_ARCH_EXT_IDIV__
598 // M0-THUMB-NOT:#define __ARM_FEATURE_DSP
599 // M0-THUMB-NOT:#define __ARM_FP 0x{{.*}}
600
601 // Test whether predefines are as expected when targeting cortex-m3.
602 // RUN: %clang -target armv7 -mthumb -mcpu=cortex-m3 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M3-THUMB %s
603 // RUN: %clang -target armv7 -mthumb -mcpu=sc300 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M3-THUMB %s
604 // M3-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
605 // M3-THUMB-NOT:#define __ARM_FEATURE_DSP
606 // M3-THUMB-NOT:#define __ARM_FP 0x{{.*}}
607
608 // Test whether predefines are as expected when targeting cortex-m4 (soft FP ABI as default).
609 // RUN: %clang -target armv7 -mthumb -mcpu=cortex-m4 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M4-THUMB %s
610 // M4-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
611 // M4-THUMB:#define __ARM_FEATURE_DSP 1
612 // M4-THUMB-NOT:#define __ARM_FP 0x
613
614 // Test whether predefines are as expected when targeting cortex-m4 (softfp ABI as default).
615 // RUN: %clang -target armv7-eabi -mthumb -mcpu=cortex-m4 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M4-THUMB-ALLOW-FP-INSTR %s
616 // M4-THUMB-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1
617 // M4-THUMB-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
618 // M4-THUMB-ALLOW-FP-INSTR:#define __ARM_FP 0x6
619
620 // Test whether predefines are as expected when targeting cortex-m7 (soft FP ABI as default).
621 // RUN: %clang -target armv7 -mthumb -mcpu=cortex-m7 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M7-THUMB %s
622 // M7-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
623 // M7-THUMB:#define __ARM_FEATURE_DSP 1
624 // M7-THUMB-NOT:#define __ARM_FP 0x
625 // M7-THUMB-NOT:#define __ARM_FPV5__
626
627 // Test whether predefines are as expected when targeting cortex-m7 (softfp FP ABI as default).
628 // RUN: %clang -target armv7-eabi -mthumb -mcpu=cortex-m7 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M7-THUMB-ALLOW-FP-INSTR %s
629 // M7-THUMB-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1
630 // M7-THUMB-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
631 // M7-THUMB-ALLOW-FP-INSTR:#define __ARM_FP 0xe
632 // M7-THUMB-ALLOW-FP-INSTR:#define __ARM_FPV5__ 1
633
634 // Test whether predefines are as expected when targeting v8m cores
635 // RUN: %clang -target arm -mcpu=cortex-m23 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M23 %s
636 // M23: #define __ARM_ARCH 8
637 // M23: #define __ARM_ARCH_8M_BASE__ 1
638 // M23: #define __ARM_ARCH_EXT_IDIV__ 1
639 // M23-NOT: __ARM_ARCH_ISA_ARM
640 // M23: #define __ARM_ARCH_ISA_THUMB 1
641 // M23: #define __ARM_ARCH_PROFILE 'M'
642 // M23-NOT: __ARM_FEATURE_CRC32
643 // M23-NOT: __ARM_FEATURE_DSP
644 // M23-NOT: __ARM_FP 0x{{.*}}
645 // M23-NOT: __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1
646
647 // Test whether predefines are as expected when targeting m33 (soft FP ABI as default).
648 // RUN: %clang -target arm -mcpu=cortex-m33 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M33 %s
649 // M33: #define __ARM_ARCH 8
650 // M33: #define __ARM_ARCH_8M_MAIN__ 1
651 // M33: #define __ARM_ARCH_EXT_IDIV__ 1
652 // M33-NOT: __ARM_ARCH_ISA_ARM
653 // M33: #define __ARM_ARCH_ISA_THUMB 2
654 // M33: #define __ARM_ARCH_PROFILE 'M'
655 // M33-NOT: __ARM_FEATURE_CRC32
656 // M33: #define __ARM_FEATURE_DSP 1
657 // M33-NOT: #define __ARM_FP 0x
658 // M33: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
659
660 // Test whether predefines are as expected when targeting m33 (softfp FP ABI as default).
661 // RUN: %clang -target arm-eabi -mcpu=cortex-m33 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M33-ALLOW-FP-INSTR %s
662 // M33-ALLOW-FP-INSTR: #define __ARM_ARCH 8
663 // M33-ALLOW-FP-INSTR: #define __ARM_ARCH_8M_MAIN__ 1
664 // M33-ALLOW-FP-INSTR: #define __ARM_ARCH_EXT_IDIV__ 1
665 // M33-ALLOW-FP-INSTR-NOT: __ARM_ARCH_ISA_ARM
666 // M33-ALLOW-FP-INSTR: #define __ARM_ARCH_ISA_THUMB 2
667 // M33-ALLOW-FP-INSTR: #define __ARM_ARCH_PROFILE 'M'
668 // M33-ALLOW-FP-INSTR-NOT: __ARM_FEATURE_CRC32
669 // M33-ALLOW-FP-INSTR: #define __ARM_FEATURE_DSP 1
670 // M33-ALLOW-FP-INSTR: #define __ARM_FP 0x6
671 // M33-ALLOW-FP-INSTR: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
672
673 // Test whether predefines are as expected when targeting krait (soft FP as default).
674 // RUN: %clang -target armv7 -mcpu=krait -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=KRAIT %s
675 // RUN: %clang -target armv7 -mthumb -mcpu=krait -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=KRAIT %s
676 // KRAIT:#define __ARM_ARCH_EXT_IDIV__ 1
677 // KRAIT:#define __ARM_FEATURE_DSP 1
678 // KRAIT-NOT:#define  __ARM_VFPV4__
679
680 // Test whether predefines are as expected when targeting krait (softfp FP as default).
681 // RUN: %clang -target armv7-eabi -mcpu=krait -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=KRAIT-ALLOW-FP-INSTR %s
682 // RUN: %clang -target armv7-eabi -mthumb -mcpu=krait -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=KRAIT-ALLOW-FP-INSTR %s
683 // KRAIT-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1
684 // KRAIT-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
685 // KRAIT-ALLOW-FP-INSTR:#define  __ARM_VFPV4__ 1
686
687 // RUN: %clang -target armv8.1a-none-none-eabi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V81A %s
688 // CHECK-V81A: #define __ARM_ARCH 8
689 // CHECK-V81A: #define __ARM_ARCH_8_1A__ 1
690 // CHECK-V81A: #define __ARM_ARCH_PROFILE 'A'
691 // CHECK-V81A: #define __ARM_FEATURE_QRDMX 1
692 // CHECK-V81A: #define __ARM_FP 0xe
693
694 // RUN: %clang -target armv8.2a-none-none-eabi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V82A %s
695 // CHECK-V82A: #define __ARM_ARCH 8
696 // CHECK-V82A: #define __ARM_ARCH_8_2A__ 1
697 // CHECK-V82A: #define __ARM_ARCH_PROFILE 'A'
698 // CHECK-V82A: #define __ARM_FEATURE_QRDMX 1
699 // CHECK-V82A: #define __ARM_FP 0xe