Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / Preprocessor / arm-target-features.c
blob1539d03a044fa14edf3ddbba6c906ae0f869f449
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 // CHECK-V8A-NOT: #define __ARM_BF16_FORMAT_ALTERNATIVE
11 // CHECK-V8A-NOT: #define __ARM_FEATURE_BF16
12 // CHECK-V8A-NOT: #define __ARM_FEATURE_BF16_VECTOR_ARITHMETIC
14 // 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
15 // 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
16 // CHECK-V8A-ALLOW-FP-INSTR: #define __ARMEL__ 1
17 // CHECK-V8A-ALLOW-FP-INSTR: #define __ARM_ARCH 8
18 // CHECK-V8A-ALLOW-FP-INSTR: #define __ARM_ARCH_8A__ 1
19 // CHECK-V8A-ALLOW-FP-INSTR: #define __ARM_FEATURE_CRC32 1
20 // CHECK-V8A-ALLOW-FP-INSTR: #define __ARM_FEATURE_DIRECTED_ROUNDING 1
21 // CHECK-V8A-ALLOW-FP-INSTR: #define __ARM_FEATURE_NUMERIC_MAXMIN 1
22 // CHECK-V8A-ALLOW-FP-INSTR: #define __ARM_FP 0xe
23 // CHECK-V8A-ALLOW-FP-INSTR: #define __ARM_FP16_ARGS 1
24 // CHECK-V8A-ALLOW-FP-INSTR: #define __ARM_FP16_FORMAT_IEEE 1
25 // CHECK-V8A-ALLOW-FP-INSTR-V8A-NOT: #define __ARM_FEATURE_DOTPROD
27 // RUN: %clang -target arm-none-linux-gnueabi -march=armv8.2-a+nofp16fml+fp16 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FULLFP16-VECTOR-SCALAR %s
28 // RUN: %clang -target arm-none-linux-gnueabi -march=armv8.2-a+nofp16+fp16fml -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FULLFP16-VECTOR-SCALAR %s
29 // RUN: %clang -target arm-none-linux-gnueabi -march=armv8.2-a+fp16+nofp16fml -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FULLFP16-VECTOR-SCALAR %s
30 // RUN: %clang -target arm-none-linux-gnueabi -march=armv8-a+fp16fml -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FULLFP16-VECTOR-SCALAR %s
31 // RUN: %clang -target arm-none-linux-gnueabi -march=armv8-a+fp16 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FULLFP16-VECTOR-SCALAR %s
32 // RUN: %clang -target arm-none-linux-gnueabi -march=armv8.4-a+nofp16fml+fp16 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FULLFP16-VECTOR-SCALAR %s
33 // RUN: %clang -target arm-none-linux-gnueabi -march=armv8.4-a+nofp16+fp16fml -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FULLFP16-VECTOR-SCALAR %s
34 // RUN: %clang -target arm-none-linux-gnueabi -march=armv8.4-a+fp16+nofp16fml -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FULLFP16-VECTOR-SCALAR %s
35 // RUN: %clang -target arm-none-linux-gnueabi -march=armv8.4-a+fp16fml -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FULLFP16-VECTOR-SCALAR %s
36 // RUN: %clang -target arm-none-linux-gnueabi -march=armv8.4-a+fp16 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FULLFP16-VECTOR-SCALAR %s
37 // CHECK-FULLFP16-VECTOR-SCALAR: #define __ARM_FEATURE_FP16_SCALAR_ARITHMETIC 1
38 // CHECK-FULLFP16-VECTOR-SCALAR: #define __ARM_FEATURE_FP16_VECTOR_ARITHMETIC 1
39 // CHECK-FULLFP16-VECTOR-SCALAR: #define __ARM_FP 0xe
40 // CHECK-FULLFP16-VECTOR-SCALAR: #define __ARM_FP16_FORMAT_IEEE 1
42 // +fp16fml without neon doesn't make sense as the fp16fml instructions all require SIMD.
43 // However, as +fp16fml implies +fp16 there is a set of defines that we would expect.
44 // RUN: %clang -target arm-none-linux-gnueabi -march=armv8-a+fp16fml -mfpu=vfp4 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FULLFP16-SCALAR %s
45 // RUN: %clang -target arm-none-linux-gnueabi -march=armv8-a+fp16 -mfpu=vfp4 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FULLFP16-SCALAR %s
46 // RUN: %clang -target arm-none-linux-gnueabi -march=armv8.4-a+fp16fml -mfpu=vfp4 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FULLFP16-SCALAR %s
47 // RUN: %clang -target arm-none-linux-gnueabi -march=armv8.4-a+fp16 -mfpu=vfp4 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FULLFP16-SCALAR %s
48 // CHECK-FULLFP16-SCALAR: #define __ARM_FEATURE_FP16_SCALAR_ARITHMETIC 1
49 // CHECK-FULLFP16-SCALAR-NOT: #define __ARM_FEATURE_FP16_VECTOR_ARITHMETIC 1
50 // CHECK-FULLFP16-SCALAR: #define __ARM_FP 0xe
51 // CHECK-FULLFP16-SCALAR: #define __ARM_FP16_FORMAT_IEEE 1
53 // RUN: %clang -target arm-none-linux-gnueabi -march=armv8.2-a -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FULLFP16-NOFML-VECTOR-SCALAR %s
54 // RUN: %clang -target arm-none-linux-gnueabi -march=armv8.2-a+nofp16 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FULLFP16-NOFML-VECTOR-SCALAR %s
55 // RUN: %clang -target arm-none-linux-gnueabi -march=armv8.2-a+nofp16fml -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FULLFP16-NOFML-VECTOR-SCALAR %s
56 // RUN: %clang -target arm-none-linux-gnueabi -march=armv8.2-a+fp16fml+nofp16 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FULLFP16-NOFML-VECTOR-SCALAR %s
57 // RUN: %clang -target arm-none-linux-gnueabi -march=armv8.4-a -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FULLFP16-NOFML-VECTOR-SCALAR %s
58 // RUN: %clang -target arm-none-linux-gnueabi -march=armv8.4-a+nofp16 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FULLFP16-NOFML-VECTOR-SCALAR %s
59 // RUN: %clang -target arm-none-linux-gnueabi -march=armv8.4-a+nofp16fml -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FULLFP16-NOFML-VECTOR-SCALAR %s
60 // RUN: %clang -target arm-none-linux-gnueabi -march=armv8.4-a+fp16fml+nofp16 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FULLFP16-NOFML-VECTOR-SCALAR %s
61 // CHECK-FULLFP16-NOFML-VECTOR-SCALAR-NOT: #define __ARM_FEATURE_FP16_SCALAR_ARITHMETIC 1
62 // CHECK-FULLFP16-NOFML-VECTOR-SCALAR-NOT: #define __ARM_FEATURE_FP16_VECTOR_ARITHMETIC 1
63 // CHECK-FULLFP16-NOFML-VECTOR-SCALAR: #define __ARM_FP 0xe
64 // CHECK-FULLFP16-NOFML-VECTOR-SCALAR: #define __ARM_FP16_FORMAT_IEEE 1
66 // RUN: %clang -target arm -march=armv8-a+fp16 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FULLFP16-SOFT %s
67 // RUN: %clang -target arm -march=armv8-a+fp16fml -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FULLFP16-SOFT %s
68 // RUN: %clang -target arm -march=armv8-a+fp16+fp16fml -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FULLFP16-SOFT %s
69 // RUN: %clang -target arm -march=armv8-a+fp16fml+fp16 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FULLFP16-SOFT %s
70 // RUN: %clang -target arm -march=armv8.4-a+fp16 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FULLFP16-SOFT %s
71 // RUN: %clang -target arm -march=armv8.4-a+fp16fml -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FULLFP16-SOFT %s
72 // RUN: %clang -target arm -march=armv8.4-a+fp16+fp16fml -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FULLFP16-SOFT %s
73 // RUN: %clang -target arm -march=armv8.4-a+fp16fml+fp16 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FULLFP16-SOFT %s
74 // CHECK-FULLFP16-SOFT-NOT: #define __ARM_FEATURE_FP16_SCALAR_ARITHMETIC
75 // CHECK-FULLFP16-SOFT-NOT: #define __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
76 // CHECK-FULLFP16-SOFT-NOT: #define __ARM_FEATURE_FP16_SCALAR_ARITHMETIC
77 // CHECK-FULLFP16-SOFT-NOT: #define __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
79 // 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
80 // CHECK-DOTPROD: #define __ARM_FEATURE_DOTPROD 1
82 // RUN: %clang -target armv8r-none-linux-gnu -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V8R %s
83 // CHECK-V8R: #define __ARMEL__ 1
84 // CHECK-V8R: #define __ARM_ARCH 8
85 // CHECK-V8R: #define __ARM_ARCH_8R__ 1
86 // CHECK-V8R: #define __ARM_FEATURE_CRC32 1
87 // CHECK-V8R: #define __ARM_FEATURE_DIRECTED_ROUNDING 1
88 // CHECK-V8R: #define __ARM_FEATURE_NUMERIC_MAXMIN 1
89 // CHECK-V8R-NOT: #define __ARM_FP 0x
91 // 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
92 // 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
93 // CHECK-V8R-ALLOW-FP-INSTR: #define __ARMEL__ 1
94 // CHECK-V8R-ALLOW-FP-INSTR: #define __ARM_ARCH 8
95 // CHECK-V8R-ALLOW-FP-INSTR: #define __ARM_ARCH_8R__ 1
96 // CHECK-V8R-ALLOW-FP-INSTR: #define __ARM_FEATURE_CRC32 1
97 // CHECK-V8R-ALLOW-FP-INSTR: #define __ARM_FEATURE_DIRECTED_ROUNDING 1
98 // CHECK-V8R-ALLOW-FP-INSTR: #define __ARM_FEATURE_NUMERIC_MAXMIN 1
99 // CHECK-V8R-ALLOW-FP-INSTR: #define __ARM_FP 0xe
101 // RUN: %clang -target armv7a-none-linux-gnu -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V7 %s
102 // CHECK-V7: #define __ARMEL__ 1
103 // CHECK-V7: #define __ARM_ARCH 7
104 // CHECK-V7: #define __ARM_ARCH_7A__ 1
105 // CHECK-V7-NOT: __ARM_FEATURE_CRC32
106 // CHECK-V7-NOT: __ARM_FEATURE_NUMERIC_MAXMIN
107 // CHECK-V7-NOT: __ARM_FEATURE_DIRECTED_ROUNDING
108 // CHECK-V7-NOT: #define __ARM_FP 0x
110 // 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
111 // 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
112 // CHECK-V7-ALLOW-FP-INSTR: #define __ARMEL__ 1
113 // CHECK-V7-ALLOW-FP-INSTR: #define __ARM_ARCH 7
114 // CHECK-V7-ALLOW-FP-INSTR: #define __ARM_ARCH_7A__ 1
115 // CHECK-V7-ALLOW-FP-INSTR-NOT: __ARM_FEATURE_CRC32
116 // CHECK-V7-ALLOW-FP-INSTR-NOT: __ARM_FEATURE_NUMERIC_MAXMIN
117 // CHECK-V7-ALLOW-FP-INSTR-NOT: __ARM_FEATURE_DIRECTED_ROUNDING
118 // CHECK-V7-ALLOW-FP-INSTR: #define __ARM_FP 0xc
120 // RUN: %clang -target armv7ve-none-linux-gnu -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V7VE %s
121 // CHECK-V7VE: #define __ARMEL__ 1
122 // CHECK-V7VE: #define __ARM_ARCH 7
123 // CHECK-V7VE: #define __ARM_ARCH_7VE__ 1
124 // CHECK-V7VE: #define __ARM_ARCH_EXT_IDIV__ 1
125 // CHECK-V7VE-NOT: #define __ARM_FP 0x
127 // 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
128 // 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
129 // CHECK-V7VE-DEFAULT-ABI-SOFT: #define __ARMEL__ 1
130 // CHECK-V7VE-DEFAULT-ABI-SOFT: #define __ARM_ARCH 7
131 // CHECK-V7VE-DEFAULT-ABI-SOFT: #define __ARM_ARCH_7VE__ 1
132 // CHECK-V7VE-DEFAULT-ABI-SOFT: #define __ARM_ARCH_EXT_IDIV__ 1
133 // CHECK-V7VE-DEFAULT-ABI-SOFT: #define __ARM_FP 0xc
135 // 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
136 // CHECK-V7S: #define __ARMEL__ 1
137 // CHECK-V7S: #define __ARM_ARCH 7
138 // CHECK-V7S: #define __ARM_ARCH_7S__ 1
139 // CHECK-V7S-NOT: __ARM_FEATURE_CRC32
140 // CHECK-V7S-NOT: __ARM_FEATURE_NUMERIC_MAXMIN
141 // CHECK-V7S-NOT: __ARM_FEATURE_DIRECTED_ROUNDING
142 // CHECK-V7S: #define __ARM_FP 0xe
144 // RUN: %clang -target arm-arm-none-eabi -march=armv7-m -mfloat-abi=soft -x c -E -dM %s | FileCheck -match-full-lines --check-prefix=CHECK-VFP-FP %s
145 // RUN: %clang -target arm-arm-none-eabi -march=armv7-m -mfloat-abi=softfp -x c -E -dM %s | FileCheck -match-full-lines --check-prefix=CHECK-VFP-FP %s
146 // RUN: %clang -target arm-arm-none-eabi -march=armv7-m -mfloat-abi=hard -x c -E -dM %s | FileCheck -match-full-lines --check-prefix=CHECK-VFP-FP %s
147 // CHECK-VFP-FP: #define __VFP_FP__ 1
149 // RUN: %clang -target armv8a -mfloat-abi=hard -x c -E -dM %s | FileCheck -match-full-lines --check-prefix=CHECK-V8-BAREHF %s
150 // CHECK-V8-BAREHF: #define __ARMEL__ 1
151 // CHECK-V8-BAREHF: #define __ARM_ARCH 8
152 // CHECK-V8-BAREHF: #define __ARM_ARCH_8A__ 1
153 // CHECK-V8-BAREHF: #define __ARM_FEATURE_CRC32 1
154 // CHECK-V8-BAREHF: #define __ARM_FEATURE_DIRECTED_ROUNDING 1
155 // CHECK-V8-BAREHF: #define __ARM_FEATURE_NUMERIC_MAXMIN 1
156 // CHECK-V8-BAREHP: #define __ARM_FP 0xe
157 // CHECK-V8-BAREHF: #define __ARM_NEON__ 1
158 // CHECK-V8-BAREHF: #define __ARM_PCS_VFP 1
159 // CHECK-V8-BAREHF: #define __VFP_FP__ 1
161 // 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
162 // CHECK-V8-BAREHF-FP-NOT: __ARM_NEON__ 1
163 // CHECK-V8-BAREHP-FP: #define __ARM_FP 0xe
164 // CHECK-V8-BAREHF-FP: #define __VFP_FP__ 1
166 // 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
167 // 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
168 // CHECK-V8-BAREHP-NEON-FP: #define __ARM_FP 0xe
169 // CHECK-V8-BAREHF-NEON-FP: #define __ARM_NEON__ 1
170 // CHECK-V8-BAREHF-NEON-FP: #define __VFP_FP__ 1
172 // RUN: %clang -target armv8a -mnocrc -x c -E -dM %s | FileCheck -match-full-lines --check-prefix=CHECK-V8-NOCRC %s
173 // CHECK-V8-NOCRC-NOT: __ARM_FEATURE_CRC32 1
175 // Check that -mhwdiv works properly for armv8/thumbv8 (enabled by default).
177 // RUN: %clang -target armv8 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8 %s
178 // RUN: %clang -target armv8 -mthumb -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8 %s
179 // RUN: %clang -target armv8-eabi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8 %s
180 // RUN: %clang -target armv8-eabi -mthumb -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8 %s
181 // V8:#define __ARM_ARCH_EXT_IDIV__ 1
183 // RUN: %clang -target armv8 -mhwdiv=none -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NOHWDIV-V8 %s
184 // RUN: %clang -target armv8 -mthumb -mhwdiv=none -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NOHWDIV-V8 %s
185 // RUN: %clang -target armv8 -mhwdiv=thumb -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NOHWDIV-V8 %s
186 // RUN: %clang -target armv8 -mthumb -mhwdiv=arm -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NOHWDIV-V8 %s
187 // NOHWDIV-V8-NOT:#define __ARM_ARCH_EXT_IDIV__
189 // RUN: %clang -target armv8a -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8A %s
190 // RUN: %clang -target armv8a -mthumb -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8A %s
191 // V8A:#define __ARM_ARCH_EXT_IDIV__ 1
192 // V8A-NOT:#define __ARM_FP 0x
194 // RUN: %clang -target armv8a-eabi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8A-ALLOW-FP-INSTR %s
195 // RUN: %clang -target armv8a-eabi -mthumb -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8A-ALLOW-FP-INSTR %s
196 // RUN: %clang -target armv8a-eabihf -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8A-ALLOW-FP-INSTR %s
197 // RUN: %clang -target armv8a-eabihf -mthumb -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8A-ALLOW-FP-INSTR %s
198 // V8A-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1
199 // V8A-ALLOW-FP-INSTR:#define __ARM_FP 0xe
201 // RUN: %clang -target armv8m.base-none-linux-gnu -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8M_BASELINE %s
202 // V8M_BASELINE: #define __ARM_ARCH 8
203 // V8M_BASELINE: #define __ARM_ARCH_8M_BASE__ 1
204 // V8M_BASELINE: #define __ARM_ARCH_EXT_IDIV__ 1
205 // V8M_BASELINE-NOT: __ARM_ARCH_ISA_ARM
206 // V8M_BASELINE: #define __ARM_ARCH_ISA_THUMB 1
207 // V8M_BASELINE: #define __ARM_ARCH_PROFILE 'M'
208 // V8M_BASELINE-NOT: __ARM_FEATURE_CRC32
209 // V8M_BASELINE: #define __ARM_FEATURE_CMSE 1
210 // V8M_BASELINE-NOT: __ARM_FEATURE_DSP
211 // V8M_BASELINE-NOT: __ARM_FP 0x{{.*}}
212 // V8M_BASELINE-NOT: __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1
214 // RUN: %clang -target armv8m.main-none-linux-gnu -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8M_MAINLINE %s
215 // V8M_MAINLINE: #define __ARM_ARCH 8
216 // V8M_MAINLINE: #define __ARM_ARCH_8M_MAIN__ 1
217 // V8M_MAINLINE: #define __ARM_ARCH_EXT_IDIV__ 1
218 // V8M_MAINLINE-NOT: __ARM_ARCH_ISA_ARM
219 // V8M_MAINLINE: #define __ARM_ARCH_ISA_THUMB 2
220 // V8M_MAINLINE: #define __ARM_ARCH_PROFILE 'M'
221 // V8M_MAINLINE-NOT: __ARM_FEATURE_CRC32
222 // V8M_MAINLINE: #define __ARM_FEATURE_CMSE 1
223 // V8M_MAINLINE-NOT: __ARM_FEATURE_DSP
224 // V8M_MAINLINE-NOT: #define __ARM_FP 0x
225 // V8M_MAINLINE: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
227 // 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
228 // 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
229 // V8M-MAINLINE-ALLOW-FP-INSTR: #define __ARM_ARCH 8
230 // V8M-MAINLINE-ALLOW-FP-INSTR: #define __ARM_ARCH_8M_MAIN__ 1
231 // V8M-MAINLINE-ALLOW-FP-INSTR: #define __ARM_ARCH_EXT_IDIV__ 1
232 // V8M-MAINLINE-ALLOW-FP-INSTR-NOT: __ARM_ARCH_ISA_ARM
233 // V8M-MAINLINE-ALLOW-FP-INSTR: #define __ARM_ARCH_ISA_THUMB 2
234 // V8M-MAINLINE-ALLOW-FP-INSTR: #define __ARM_ARCH_PROFILE 'M'
235 // V8M-MAINLINE-ALLOW-FP-INSTR-NOT: __ARM_FEATURE_CRC32
236 // V8M-MAINLINE-ALLOW-FP-INSTR-NOT: __ARM_FEATURE_DSP
237 // V8M-MAINLINE-ALLOW-FP-INSTR: #define __ARM_FP 0xe
238 // V8M-MAINLINE-ALLOW-FP-INSTR: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
240 // 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
241 // V8M_MAINLINE_DSP: #define __ARM_ARCH 8
242 // V8M_MAINLINE_DSP: #define __ARM_ARCH_8M_MAIN__ 1
243 // V8M_MAINLINE_DSP: #define __ARM_ARCH_EXT_IDIV__ 1
244 // V8M_MAINLINE_DSP-NOT: __ARM_ARCH_ISA_ARM
245 // V8M_MAINLINE_DSP: #define __ARM_ARCH_ISA_THUMB 2
246 // V8M_MAINLINE_DSP: #define __ARM_ARCH_PROFILE 'M'
247 // V8M_MAINLINE_DSP-NOT: __ARM_FEATURE_CRC32
248 // V8M_MAINLINE_DSP: #define __ARM_FEATURE_DSP 1
249 // V8M_MAINLINE_DSP-NOT: #define __ARM_FP 0x
250 // V8M_MAINLINE_DSP: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
252 // 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
253 // V8M-MAINLINE-DSP-ALLOW-FP-INSTR: #define __ARM_ARCH 8
254 // V8M-MAINLINE-DSP-ALLOW-FP-INSTR: #define __ARM_ARCH_8M_MAIN__ 1
255 // V8M-MAINLINE-DSP-ALLOW-FP-INSTR: #define __ARM_ARCH_EXT_IDIV__ 1
256 // V8M-MAINLINE-DSP-ALLOW-FP-INSTR-NOT: __ARM_ARCH_ISA_ARM
257 // V8M-MAINLINE-DSP-ALLOW-FP-INSTR: #define __ARM_ARCH_ISA_THUMB 2
258 // V8M-MAINLINE-DSP-ALLOW-FP-INSTR: #define __ARM_ARCH_PROFILE 'M'
259 // V8M-MAINLINE-DSP-ALLOW-FP-INSTR-NOT: __ARM_FEATURE_CRC32
260 // V8M-MAINLINE-DSP-ALLOW-FP-INSTR: #define __ARM_FEATURE_DSP 1
261 // V8M-MAINLINE-DSP-ALLOW-FP-INSTR: #define __ARM_FP 0xe
262 // V8M-MAINLINE-DSP-ALLOW-FP-INSTR: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
264 // RUN: %clang -target arm-none-linux-gnu -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-DEFS %s
265 // CHECK-DEFS:#define __ARM_PCS 1
266 // CHECK-DEFS:#define __ARM_SIZEOF_MINIMAL_ENUM 4
267 // CHECK-DEFS:#define __ARM_SIZEOF_WCHAR_T 4
269 // RUN: %clang -target arm-none-linux-gnu -fno-math-errno -fno-signed-zeros\
270 // RUN: -fno-trapping-math -fassociative-math -freciprocal-math -fapprox-func\
271 // RUN: -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FASTMATH %s
272 // RUN: %clang -target arm-none-linux-gnu -ffast-math -x c -E -dM %s -o -\
273 // RUN: | FileCheck -match-full-lines --check-prefix=CHECK-FASTMATH %s
274 // CHECK-FASTMATH: #define __ARM_FP_FAST 1
276 // RUN: %clang -target arm-none-linux-gnu -fshort-wchar -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-SHORTWCHAR %s
277 // CHECK-SHORTWCHAR:#define __ARM_SIZEOF_WCHAR_T 2
279 // RUN: %clang -target arm-none-linux-gnu -fshort-enums -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-SHORTENUMS %s
280 // CHECK-SHORTENUMS:#define __ARM_SIZEOF_MINIMAL_ENUM 1
282 // Test that -mhwdiv has the right effect for a target CPU which has hwdiv enabled by default.
283 // RUN: %clang -target armv7 -mcpu=cortex-a15 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=HWDIV %s
284 // RUN: %clang -target armv7 -mthumb -mcpu=cortex-a15 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=HWDIV %s
285 // RUN: %clang -target armv7 -mcpu=cortex-a15 -mhwdiv=arm -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=HWDIV %s
286 // RUN: %clang -target armv7 -mthumb -mcpu=cortex-a15 -mhwdiv=thumb -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=HWDIV %s
287 // HWDIV:#define __ARM_ARCH_EXT_IDIV__ 1
289 // RUN: %clang -target arm -mcpu=cortex-a15 -mhwdiv=thumb -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NOHWDIV %s
290 // RUN: %clang -target arm -mthumb -mcpu=cortex-a15 -mhwdiv=arm -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NOHWDIV %s
291 // RUN: %clang -target arm -mcpu=cortex-a15 -mhwdiv=none -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NOHWDIV %s
292 // RUN: %clang -target arm -mthumb -mcpu=cortex-a15 -mhwdiv=none -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NOHWDIV %s
293 // NOHWDIV-NOT:#define __ARM_ARCH_EXT_IDIV__
296 // Check that -mfpu works properly for Cortex-A7 (enabled by default).
297 // 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
298 // 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
299 // 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
300 // 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
301 // DEFAULTFPU-A7:#define __ARM_FP 0xe
302 // DEFAULTFPU-A7:#define __ARM_NEON__ 1
303 // DEFAULTFPU-A7:#define __ARM_VFPV4__ 1
305 // 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
306 // 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
307 // FPUNONE-A7-NOT:#define __ARM_FP 0x{{.*}}
308 // FPUNONE-A7-NOT:#define __ARM_NEON__ 1
309 // FPUNONE-A7-NOT:#define __ARM_VFPV4__ 1
311 // 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
312 // 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
313 // NONEON-A7:#define __ARM_FP 0xe
314 // NONEON-A7-NOT:#define __ARM_NEON__ 1
315 // NONEON-A7:#define __ARM_VFPV4__ 1
317 // Check that -mfpu works properly for Cortex-A5 (enabled by default).
318 // 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
319 // 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
320 // DEFAULTFPU-A5:#define __ARM_FP 0xe
321 // DEFAULTFPU-A5:#define __ARM_NEON__ 1
322 // DEFAULTFPU-A5:#define __ARM_VFPV4__ 1
324 // 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
325 // 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
326 // FPUNONE-A5-NOT:#define __ARM_FP 0x{{.*}}
327 // FPUNONE-A5-NOT:#define __ARM_NEON__ 1
328 // FPUNONE-A5-NOT:#define __ARM_VFPV4__ 1
330 // 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
331 // 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
332 // NONEON-A5:#define __ARM_FP 0xe
333 // NONEON-A5-NOT:#define __ARM_NEON__ 1
334 // NONEON-A5:#define __ARM_VFPV4__ 1
336 // FIXME: add check for further predefines
337 // Test whether predefines are as expected when targeting ep9312.
338 // RUN: %clang -target armv4t -mcpu=ep9312 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A4T %s
339 // A4T-NOT:#define __ARM_FEATURE_DSP
340 // A4T-NOT:#define __ARM_FP 0x{{.*}}
342 // Test whether predefines are as expected when targeting arm10tdmi.
343 // RUN: %clang -target armv5 -mcpu=arm10tdmi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A5T %s
344 // A5T-NOT:#define __ARM_FEATURE_DSP
345 // A5T-NOT:#define __ARM_FP 0x{{.*}}
347 // Test whether predefines are as expected when targeting cortex-a5i (soft FP ABI as default).
348 // RUN: %clang -target armv7 -mcpu=cortex-a5 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A5 %s
349 // RUN: %clang -target armv7 -mthumb -mcpu=cortex-a5 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A5 %s
350 // A5:#define __ARM_ARCH 7
351 // A5:#define __ARM_ARCH_7A__ 1
352 // A5-NOT:#define __ARM_ARCH_EXT_IDIV__
353 // A5:#define __ARM_ARCH_PROFILE 'A'
354 // A5-NOT:#define __ARM_DWARF_EH__ 1
355 // A5-NOT: #define __ARM_FEATURE_DIRECTED_ROUNDING
356 // A5:#define __ARM_FEATURE_DSP 1
357 // A5-NOT: #define __ARM_FEATURE_NUMERIC_MAXMIN
358 // A5-NOT:#define __ARM_FP 0x
360 // Test whether predefines are as expected when targeting cortex-a5 (softfp FP ABI as default).
361 // 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
362 // 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
363 // A5-ALLOW-FP-INSTR:#define __ARM_ARCH 7
364 // A5-ALLOW-FP-INSTR:#define __ARM_ARCH_7A__ 1
365 // A5-ALLOW-FP-INSTR-NOT:#define __ARM_ARCH_EXT_IDIV__
366 // A5-ALLOW-FP-INSTR:#define __ARM_ARCH_PROFILE 'A'
367 // A5-ALLOW-FP-INSTR-NOT: #define __ARM_FEATURE_DIRECTED_ROUNDING
368 // A5-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
369 // A5-ALLOW-FP-INSTR-NOT: #define __ARM_FEATURE_NUMERIC_MAXMIN
370 // A5-ALLOW-FP-INSTR:#define __ARM_FP 0xe
372 // Test whether predefines are as expected when targeting cortex-a7 (soft FP ABI as default).
373 // RUN: %clang -target armv7k -mcpu=cortex-a7 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A7 %s
374 // RUN: %clang -target armv7k -mthumb -mcpu=cortex-a7 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A7 %s
375 // A7:#define __ARM_ARCH 7
376 // A7:#define __ARM_ARCH_EXT_IDIV__ 1
377 // A7:#define __ARM_ARCH_PROFILE 'A'
378 // A7-NOT:#define __ARM_DWARF_EH__ 1
379 // A7:#define __ARM_FEATURE_DSP 1
380 // A7-NOT:#define __ARM_FP 0x
382 // Test whether predefines are as expected when targeting cortex-a7 (softfp FP ABI as default).
383 // 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
384 // 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
385 // A7-ALLOW-FP-INSTR:#define __ARM_ARCH 7
386 // A7-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1
387 // A7-ALLOW-FP-INSTR:#define __ARM_ARCH_PROFILE 'A'
388 // A7-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
389 // A7-ALLOW-FP-INSTR:#define __ARM_FP 0xe
391 // Test whether predefines are as expected when targeting cortex-a7.
392 // RUN: %clang -target x86_64-apple-darwin -arch armv7k -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV7K %s
393 // ARMV7K:#define __ARM_ARCH 7
394 // ARMV7K:#define __ARM_ARCH_EXT_IDIV__ 1
395 // ARMV7K:#define __ARM_ARCH_PROFILE 'A'
396 // ARMV7K:#define __ARM_DWARF_EH__ 1
397 // ARMV7K:#define __ARM_FEATURE_DSP 1
398 // ARMV7K:#define __ARM_FP 0xe
399 // ARMV7K:#define __ARM_PCS_VFP 1
402 // Test whether predefines are as expected when targeting cortex-a8 (soft FP ABI as default).
403 // RUN: %clang -target armv7 -mcpu=cortex-a8 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A8 %s
404 // RUN: %clang -target armv7 -mthumb -mcpu=cortex-a8 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A8 %s
405 // A8-NOT:#define __ARM_ARCH_EXT_IDIV__
406 // A8:#define __ARM_FEATURE_DSP 1
407 // A8-NOT:#define __ARM_FP 0x
409 // Test whether predefines are as expected when targeting cortex-a8 (softfp FP ABI as default).
410 // 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
411 // 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
412 // A8-ALLOW-FP-INSTR-NOT:#define __ARM_ARCH_EXT_IDIV__
413 // A8-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
414 // A8-ALLOW-FP-INSTR:#define __ARM_FP 0xc
416 // Test whether predefines are as expected when targeting cortex-a9 (soft FP as default).
417 // RUN: %clang -target armv7 -mcpu=cortex-a9 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A9 %s
418 // RUN: %clang -target armv7 -mthumb -mcpu=cortex-a9 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A9 %s
419 // A9-NOT:#define __ARM_ARCH_EXT_IDIV__
420 // A9:#define __ARM_FEATURE_DSP 1
421 // A9-NOT:#define __ARM_FP 0x
423 // Test whether predefines are as expected when targeting cortex-a9 (softfp FP as default).
424 // 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
425 // 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
426 // A9-ALLOW-FP-INSTR-NOT:#define __ARM_ARCH_EXT_IDIV__
427 // A9-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
428 // A9-ALLOW-FP-INSTR:#define __ARM_FP 0xe
431 // Check that -mfpu works properly for Cortex-A12 (enabled by default).
432 // 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
433 // 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
434 // DEFAULTFPU-A12:#define __ARM_FP 0xe
435 // DEFAULTFPU-A12:#define __ARM_NEON__ 1
436 // DEFAULTFPU-A12:#define __ARM_VFPV4__ 1
438 // 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
439 // 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
440 // FPUNONE-A12-NOT:#define __ARM_FP 0x{{.*}}
441 // FPUNONE-A12-NOT:#define __ARM_NEON__ 1
442 // FPUNONE-A12-NOT:#define __ARM_VFPV4__ 1
444 // Test whether predefines are as expected when targeting cortex-a12 (soft FP ABI as default).
445 // RUN: %clang -target armv7 -mcpu=cortex-a12 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A12 %s
446 // RUN: %clang -target armv7 -mthumb -mcpu=cortex-a12 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A12 %s
447 // A12:#define __ARM_ARCH 7
448 // A12:#define __ARM_ARCH_7A__ 1
449 // A12:#define __ARM_ARCH_EXT_IDIV__ 1
450 // A12:#define __ARM_ARCH_PROFILE 'A'
451 // A12:#define __ARM_FEATURE_DSP 1
452 // A12-NOT:#define __ARM_FP 0x
454 // Test whether predefines are as expected when targeting cortex-a12 (soft FP ABI as default).
455 // 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
456 // 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
457 // A12-ALLOW-FP-INSTR:#define __ARM_ARCH 7
458 // A12-ALLOW-FP-INSTR:#define __ARM_ARCH_7A__ 1
459 // A12-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1
460 // A12-ALLOW-FP-INSTR:#define __ARM_ARCH_PROFILE 'A'
461 // A12-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
462 // A12-ALLOW-FP-INSTR:#define __ARM_FP 0xe
464 // Test whether predefines are as expected when targeting cortex-a15 (soft FP ABI as default).
465 // RUN: %clang -target armv7 -mcpu=cortex-a15 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A15 %s
466 // RUN: %clang -target armv7 -mthumb -mcpu=cortex-a15 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A15 %s
467 // A15:#define __ARM_ARCH_EXT_IDIV__ 1
468 // A15:#define __ARM_FEATURE_DSP 1
469 // A15-NOT:#define __ARM_FP 0x
471 // Test whether predefines are as expected when targeting cortex-a15 (softfp ABI as default).
472 // 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
473 // 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
474 // A15-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1
475 // A15-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
476 // A15-ALLOW-FP-INSTR:#define __ARM_FP 0xe
478 // Check that -mfpu works properly for Cortex-A17 (enabled by default).
479 // 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
480 // 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
481 // DEFAULTFPU-A17:#define __ARM_FP 0xe
482 // DEFAULTFPU-A17:#define __ARM_NEON__ 1
483 // DEFAULTFPU-A17:#define __ARM_VFPV4__ 1
485 // 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
486 // 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
487 // FPUNONE-A17-NOT:#define __ARM_FP 0x{{.*}}
488 // FPUNONE-A17-NOT:#define __ARM_NEON__ 1
489 // FPUNONE-A17-NOT:#define __ARM_VFPV4__ 1
491 // Test whether predefines are as expected when targeting cortex-a17 (soft FP ABI as default).
492 // RUN: %clang -target armv7 -mcpu=cortex-a17 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A17 %s
493 // RUN: %clang -target armv7 -mthumb -mcpu=cortex-a17 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A17 %s
494 // A17:#define __ARM_ARCH 7
495 // A17:#define __ARM_ARCH_7A__ 1
496 // A17:#define __ARM_ARCH_EXT_IDIV__ 1
497 // A17:#define __ARM_ARCH_PROFILE 'A'
498 // A17:#define __ARM_FEATURE_DSP 1
499 // A17-NOT:#define __ARM_FP 0x
501 // Test whether predefines are as expected when targeting cortex-a17 (softfp FP ABI as default).
502 // 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
503 // 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
504 // A17-ALLOW-FP-INSTR:#define __ARM_ARCH 7
505 // A17-ALLOW-FP-INSTR:#define __ARM_ARCH_7A__ 1
506 // A17-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1
507 // A17-ALLOW-FP-INSTR:#define __ARM_ARCH_PROFILE 'A'
508 // A17-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
509 // A17-ALLOW-FP-INSTR:#define __ARM_FP 0xe
511 // Test whether predefines are as expected when targeting swift (soft FP ABI as default).
512 // RUN: %clang -target armv7s -mcpu=swift -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=SWIFT %s
513 // RUN: %clang -target armv7s -mthumb -mcpu=swift -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=SWIFT %s
514 // SWIFT:#define __ARM_ARCH_EXT_IDIV__ 1
515 // SWIFT:#define __ARM_FEATURE_DSP 1
516 // SWIFT-NOT:#define __ARM_FP 0xxE
518 // Test whether predefines are as expected when targeting swift (softfp FP ABI as default).
519 // RUN: %clang -target armv7s-eabi -mcpu=swift -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=SWIFT-ALLOW-FP-INSTR %s
520 // 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
521 // SWIFT-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1
522 // SWIFT-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
523 // SWIFT-ALLOW-FP-INSTR:#define __ARM_FP 0xe
525 // Test whether predefines are as expected when targeting ARMv8-A Cortex implementations (soft FP ABI as default)
526 // RUN: %clang -target armv8 -mcpu=cortex-a32 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
527 // RUN: %clang -target armv8 -mthumb -mcpu=cortex-a32 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
528 // RUN: %clang -target armv8 -mcpu=cortex-a35 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
529 // RUN: %clang -target armv8 -mthumb -mcpu=cortex-a35 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
530 // RUN: %clang -target armv8 -mcpu=cortex-a53 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
531 // RUN: %clang -target armv8 -mthumb -mcpu=cortex-a53 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
532 // RUN: %clang -target armv8 -mcpu=cortex-a57 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
533 // RUN: %clang -target armv8 -mthumb -mcpu=cortex-a57 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
534 // RUN: %clang -target armv8 -mcpu=cortex-a72 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
535 // RUN: %clang -target armv8 -mthumb -mcpu=cortex-a72 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
536 // RUN: %clang -target armv8 -mcpu=cortex-a73 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
537 // RUN: %clang -target armv8 -mthumb -mcpu=cortex-a73 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
539 // RUN: %clang -target armv8 -mcpu=exynos-m3 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
540 // RUN: %clang -target armv8 -mthumb -mcpu=exynos-m3 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
541 // RUN: %clang -target armv8 -mcpu=exynos-m4 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
542 // RUN: %clang -target armv8 -mthumb -mcpu=exynos-m4 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
543 // RUN: %clang -target armv8 -mcpu=exynos-m5 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
544 // RUN: %clang -target armv8 -mthumb -mcpu=exynos-m5 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
545 // ARMV8:#define __ARM_ARCH_EXT_IDIV__ 1
546 // ARMV8:#define __ARM_FEATURE_DSP 1
547 // ARMV8-NOT:#define __ARM_FP 0x
549 // Test whether predefines are as expected when targeting ARMv8-A Cortex implementations (softfp FP ABI as default)
550 // 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
551 // 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
552 // 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
553 // 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
554 // 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
555 // 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
556 // 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
557 // 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
558 // 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
559 // 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
560 // 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
561 // 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
563 // 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
564 // 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
565 // 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
566 // 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
567 // RUN: %clang -target armv8-eabi -mcpu=exynos-m5 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8-ALLOW-FP-INSTR %s
568 // RUN: %clang -target armv8-eabi -mthumb -mcpu=exynos-m5 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8-ALLOW-FP-INSTR %s
569 // ARMV8-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1
570 // ARMV8-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
571 // ARMV8-ALLOW-FP-INSTR:#define __ARM_FP 0xe
573 // Test whether predefines are as expected when targeting cortex-r4.
574 // RUN: %clang -target armv7 -mcpu=cortex-r4 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R4-ARM %s
575 // R4-ARM-NOT:#define __ARM_ARCH_EXT_IDIV__
576 // R4-ARM:#define __ARM_FEATURE_DSP 1
577 // R4-ARM-NOT:#define __ARM_FP 0x{{.*}}
579 // RUN: %clang -target armv7 -mthumb -mcpu=cortex-r4 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R4-THUMB %s
580 // R4-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
581 // R4-THUMB:#define __ARM_FEATURE_DSP 1
582 // R4-THUMB-NOT:#define __ARM_FP 0x{{.*}}
584 // Test whether predefines are as expected when targeting cortex-r4f (soft FP ABI as default).
585 // RUN: %clang -target armv7 -mcpu=cortex-r4f -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R4F-ARM %s
586 // R4F-ARM-NOT:#define __ARM_ARCH_EXT_IDIV__
587 // R4F-ARM:#define __ARM_FEATURE_DSP 1
588 // R4F-ARM-NOT:#define __ARM_FP 0x
590 // Test whether predefines are as expected when targeting cortex-r4f (softfp FP ABI as default).
591 // 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
592 // R4F-ARM-ALLOW-FP-INSTR-NOT:#define __ARM_ARCH_EXT_IDIV__
593 // R4F-ARM-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
594 // R4F-ARM-ALLOW-FP-INSTR:#define __ARM_FP 0xc
596 // RUN: %clang -target armv7 -mthumb -mcpu=cortex-r4f -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R4F-THUMB %s
597 // R4F-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
598 // R4F-THUMB:#define __ARM_FEATURE_DSP 1
599 // R4F-THUMB-NOT:#define __ARM_FP 0x
601 // 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
602 // R4F-THUMB-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1
603 // R4F-THUMB-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
604 // R4F-THUMB-ALLOW-FP-INSTR:#define __ARM_FP 0xc
606 // Test whether predefines are as expected when targeting cortex-r5 (soft FP ABI as default).
607 // RUN: %clang -target armv7 -mcpu=cortex-r5 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R5 %s
608 // RUN: %clang -target armv7 -mthumb -mcpu=cortex-r5 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R5 %s
609 // R5:#define __ARM_ARCH_EXT_IDIV__ 1
610 // R5:#define __ARM_FEATURE_DSP 1
611 // R5-NOT:#define __ARM_FP 0x
613 // Test whether predefines are as expected when targeting cortex-r5 (softfp FP ABI as default).
614 // 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
615 // 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
616 // R5-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1
617 // R5-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
618 // R5-ALLOW-FP-INSTR:#define __ARM_FP 0xc
620 // Test whether predefines are as expected when targeting cortex-r7 and cortex-r8 (soft FP ABI as default).
621 // RUN: %clang -target armv7 -mcpu=cortex-r7 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R7-R8 %s
622 // RUN: %clang -target armv7 -mthumb -mcpu=cortex-r7 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R7-R8 %s
623 // RUN: %clang -target armv7 -mcpu=cortex-r8 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R7-R8 %s
624 // RUN: %clang -target armv7 -mthumb -mcpu=cortex-r8 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R7-R8 %s
625 // R7-R8:#define __ARM_ARCH_EXT_IDIV__ 1
626 // R7-R8:#define __ARM_FEATURE_DSP 1
627 // R7-R8-NOT:#define __ARM_FP 0x
629 // Test whether predefines are as expected when targeting cortex-r7 and cortex-r8 (softfp FP ABI as default).
630 // 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
631 // 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
632 // 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
633 // 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
634 // R7-R8-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1
635 // R7-R8-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
636 // R7-R8-ALLOW-FP-INSTR:#define __ARM_FP 0xe
638 // Test whether predefines are as expected when targeting cortex-m0.
639 // RUN: %clang -target armv7 -mthumb -mcpu=cortex-m0 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M0-THUMB %s
640 // RUN: %clang -target armv7 -mthumb -mcpu=cortex-m0plus -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M0-THUMB %s
641 // RUN: %clang -target armv7 -mthumb -mcpu=cortex-m1 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M0-THUMB %s
642 // RUN: %clang -target armv7 -mthumb -mcpu=sc000 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M0-THUMB %s
643 // M0-THUMB-NOT:#define __ARM_ARCH_EXT_IDIV__
644 // M0-THUMB-NOT:#define __ARM_FEATURE_DSP
645 // M0-THUMB-NOT:#define __ARM_FP 0x{{.*}}
647 // Test whether predefines are as expected when targeting cortex-m3.
648 // RUN: %clang -target armv7 -mthumb -mcpu=cortex-m3 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M3-THUMB %s
649 // RUN: %clang -target armv7 -mthumb -mcpu=sc300 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M3-THUMB %s
650 // M3-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
651 // M3-THUMB-NOT:#define __ARM_FEATURE_DSP
652 // M3-THUMB-NOT:#define __ARM_FP 0x{{.*}}
654 // Test whether predefines are as expected when targeting cortex-m4 (soft FP ABI as default).
655 // RUN: %clang -target armv7 -mthumb -mcpu=cortex-m4 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M4-THUMB %s
656 // M4-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
657 // M4-THUMB:#define __ARM_FEATURE_DSP 1
658 // M4-THUMB-NOT:#define __ARM_FP 0x
660 // Test whether predefines are as expected when targeting cortex-m4 (softfp ABI as default).
661 // 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
662 // M4-THUMB-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1
663 // M4-THUMB-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
664 // M4-THUMB-ALLOW-FP-INSTR:#define __ARM_FP 0x6
666 // Test whether predefines are as expected when targeting cortex-m7 (soft FP ABI as default).
667 // RUN: %clang -target armv7 -mthumb -mcpu=cortex-m7 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M7-THUMB %s
668 // M7-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
669 // M7-THUMB:#define __ARM_FEATURE_DSP 1
670 // M7-THUMB-NOT:#define __ARM_FP 0x
671 // M7-THUMB-NOT:#define __ARM_FPV5__
673 // Test whether predefines are as expected when targeting cortex-m7 (softfp FP ABI as default).
674 // 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
675 // M7-THUMB-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1
676 // M7-THUMB-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
677 // M7-THUMB-ALLOW-FP-INSTR:#define __ARM_FP 0xe
678 // M7-THUMB-ALLOW-FP-INSTR:#define __ARM_FPV5__ 1
680 // Check that -mcmse (security extension) option works correctly for v8-M targets
681 // RUN: %clang -target armv8m.base-none-linux-gnu -mcmse -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8M_CMSE %s
682 // RUN: %clang -target armv8m.main-none-linux-gnu -mcmse -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8M_CMSE %s
683 // RUN: %clang -target arm-none-linux-gnu -mcpu=cortex-m33 -mcmse -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8M_CMSE %s
684 // RUN: %clang -target arm -mcpu=cortex-m23 -mcmse -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8M_CMSE %s
685 // RUN: %clang -target arm-none-linux-gnu -mcpu=cortex-m55 -mcmse -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8M_CMSE %s
686 // V8M_CMSE-NOT: __ARM_FEATURE_CMSE 1
687 // V8M_CMSE: #define __ARM_FEATURE_CMSE 3
689 // Check that CMSE is not defined on architectures w/o support for security extension
690 // RUN: %clang -target arm-arm-none-gnueabi -mcpu=cortex-a5 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NOTV8M_CMSE %s
691 // RUN: %clang -target armv8a-none-linux-gnu -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NOTV8M_CMSE %s
692 // RUN: %clang -target armv8.1a-none-none-eabi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NOTV8M_CMSE %s
693 // NOTV8M_CMSE-NOT: __ARM_FEATURE_CMSE
695 // Check that -mcmse option gives error on non v8-M targets
696 // RUN: not %clang -target arm-arm-none-eabi -mthumb -mcmse -mcpu=cortex-m7 -x c -E -dM %s -o - 2>&1 | FileCheck -match-full-lines --check-prefix=NOTV8MCMSE_OPT %s
697 // NOTV8MCMSE_OPT: error: -mcmse is not supported for cortex-m7
699 // Test whether predefines are as expected when targeting v8m cores
700 // RUN: %clang -target arm -mcpu=cortex-m23 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M23 %s
701 // M23: #define __ARM_ARCH 8
702 // M23: #define __ARM_ARCH_8M_BASE__ 1
703 // M23: #define __ARM_ARCH_EXT_IDIV__ 1
704 // M23-NOT: __ARM_ARCH_ISA_ARM
705 // M23: #define __ARM_ARCH_ISA_THUMB 1
706 // M23: #define __ARM_ARCH_PROFILE 'M'
707 // M23-NOT: __ARM_FEATURE_CRC32
708 // M23-NOT: __ARM_FEATURE_DSP
709 // M23-NOT: __ARM_FP 0x{{.*}}
710 // M23-NOT: __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1
712 // Test whether predefines are as expected when targeting m33 (soft FP ABI as default).
713 // RUN: %clang -target arm -mcpu=cortex-m33 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M33 %s
714 // M33: #define __ARM_ARCH 8
715 // M33: #define __ARM_ARCH_8M_MAIN__ 1
716 // M33: #define __ARM_ARCH_EXT_IDIV__ 1
717 // M33-NOT: __ARM_ARCH_ISA_ARM
718 // M33: #define __ARM_ARCH_ISA_THUMB 2
719 // M33: #define __ARM_ARCH_PROFILE 'M'
720 // M33-NOT: __ARM_FEATURE_CRC32
721 // M33: #define __ARM_FEATURE_DSP 1
722 // M33-NOT: #define __ARM_FP 0x
723 // M33: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
725 // Test whether predefines are as expected when targeting m33 (softfp FP ABI as default).
726 // 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
727 // M33-ALLOW-FP-INSTR: #define __ARM_ARCH 8
728 // M33-ALLOW-FP-INSTR: #define __ARM_ARCH_8M_MAIN__ 1
729 // M33-ALLOW-FP-INSTR: #define __ARM_ARCH_EXT_IDIV__ 1
730 // M33-ALLOW-FP-INSTR-NOT: __ARM_ARCH_ISA_ARM
731 // M33-ALLOW-FP-INSTR: #define __ARM_ARCH_ISA_THUMB 2
732 // M33-ALLOW-FP-INSTR: #define __ARM_ARCH_PROFILE 'M'
733 // M33-ALLOW-FP-INSTR-NOT: __ARM_FEATURE_CRC32
734 // M33-ALLOW-FP-INSTR: #define __ARM_FEATURE_DSP 1
735 // M33-ALLOW-FP-INSTR: #define __ARM_FP 0x6
736 // M33-ALLOW-FP-INSTR: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
738 // Test whether predefines are as expected when targeting cortex-m55 (softfp FP ABI as default).
739 // RUN: %clang -target arm-eabi -mcpu=cortex-m55 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M55 %s
740 // M55: #define __ARM_ARCH 8
741 // M55: #define __ARM_ARCH_8_1M_MAIN__ 1
742 // M55: #define __ARM_ARCH_EXT_IDIV__ 1
743 // M55-NOT: __ARM_ARCH_ISA_ARM
744 // M55: #define __ARM_ARCH_ISA_THUMB 2
745 // M55: #define __ARM_ARCH_PROFILE 'M'
746 // M55-NOT: __ARM_FEATURE_CRC32
747 // M55: #define __ARM_FEATURE_DSP 1
748 // M55: #define __ARM_FEATURE_MVE 3
749 // M55: #define __ARM_FP 0xe
750 // M55: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
752 // Test whether predefines are as expected when targeting krait (soft FP as default).
753 // RUN: %clang -target armv7 -mcpu=krait -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=KRAIT %s
754 // RUN: %clang -target armv7 -mthumb -mcpu=krait -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=KRAIT %s
755 // KRAIT:#define __ARM_ARCH_EXT_IDIV__ 1
756 // KRAIT:#define __ARM_FEATURE_DSP 1
757 // KRAIT-NOT:#define __ARM_VFPV4__
759 // Test whether predefines are as expected when targeting krait (softfp FP as default).
760 // RUN: %clang -target armv7-eabi -mcpu=krait -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=KRAIT-ALLOW-FP-INSTR %s
761 // 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
762 // KRAIT-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1
763 // KRAIT-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
764 // KRAIT-ALLOW-FP-INSTR:#define __ARM_VFPV4__ 1
766 // RUN: %clang -target arm-arm-none-eabi -march=armv8.1-m.main -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V81M %s
767 // CHECK-V81M: #define __ARM_ARCH 8
768 // CHECK-V81M: #define __ARM_ARCH_8_1M_MAIN__ 1
769 // CHECK-V81M: #define __ARM_ARCH_ISA_THUMB 2
770 // CHECK-V81M: #define __ARM_ARCH_PROFILE 'M'
771 // CHECK-V81M-NOT: #define __ARM_FEATURE_DSP
772 // CHECK-V81M-NOT: #define __ARM_FEATURE_MVE
773 // CHECK-V81M-NOT: #define __ARM_FEATURE_SIMD32
775 // RUN: %clang -target arm-arm-none-eabi -march=armv8.1-m.main+mve -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V81M-MVE %s
776 // CHECK-V81M-MVE: #define __ARM_FEATURE_DSP 1
777 // CHECK-V81M-MVE: #define __ARM_FEATURE_MVE 1
778 // CHECK-V81M-MVE: #define __ARM_FEATURE_SIMD32 1
780 // RUN: %clang -target arm-arm-none-eabi -march=armv8.1-m.main+mve.fp -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V81M-MVEFP %s
781 // CHECK-V81M-MVEFP: #define __ARM_FEATURE_DSP 1
782 // CHECK-V81M-MVEFP: #define __ARM_FEATURE_FP16_SCALAR_ARITHMETIC 1
783 // CHECK-V81M-MVEFP: #define __ARM_FEATURE_MVE 3
784 // CHECK-V81M-MVEFP: #define __ARM_FEATURE_SIMD32 1
785 // CHECK-V81M-MVEFP: #define __ARM_FPV5__ 1
787 // fpu=none/nofp discards mve.fp, but not mve/dsp
788 // RUN: %clang -target arm-arm-none-eabi -march=armv8.1-m.main+mve.fp+nofp -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V81M-MVEFP-NOFP %s
789 // RUN: %clang -target arm-arm-none-eabi -march=armv8.1-m.main+mve.fp -mfpu=none -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V81M-MVEFP-NOFP %s
790 // CHECK-V81M-MVEFP-NOFP: #define __ARM_FEATURE_DSP 1
791 // CHECK-V81M-MVEFP-NOFP: #define __ARM_FEATURE_MVE 1
793 // nomve discards mve.fp
794 // RUN: %clang -target arm-arm-none-eabi -march=armv8.1-m.main+mve.fp+nomve -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V81M-MVEFP-NOMVE %s
795 // CHECK-V81M-MVEFP-NOMVE-NOT: #define __ARM_FEATURE_MVE
797 // mve+fp doesn't imply mve.fp
798 // RUN: %clang -target arm-arm-none-eabi -march=armv8.1-m.main+mve+fp -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V81M-MVE-FP %s
799 // CHECK-V81M-MVE-FP: #define __ARM_FEATURE_MVE 1
801 // nodsp discards both dsp and mve ...
802 // RUN: %clang -target arm-arm-none-eabi -march=armv8.1-m.main+mve+nodsp -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V81M-MVE-NODSP %s
803 // CHECK-V81M-MVE-NODSP-NOT: #define __ARM_FEATURE_MVE
804 // CHECK-V81M-MVE-NODSP-NOT: #define __ARM_FEATURE_DSP
806 // ... and also mve.fp
807 // RUN: %clang -target arm-arm-none-eabi -march=armv8.1-m.main+mve.fp+nodsp -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V81M-MVE-NODSP %s
808 // CHECK-V81M-MVE-NODSP-NOT: #define __ARM_FEATURE_MVE
809 // CHECK-V81M-MVE-NODSP-NOT: #define __ARM_FEATURE_DSP
811 // Test CDE (Custom Datapath Extension) feature test macros
813 // RUN: %clang -target arm-arm-none-eabi -march=armv8m.main -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-V8M-NOCDE %s
814 // CHECK-V8M-NOCDE-NOT: #define __ARM_FEATURE_CDE
815 // CHECK-V8M-NOCDE-NOT: #define __ARM_FEATURE_CDE_COPROC
816 // RUN: %clang -target arm-arm-none-eabi -march=armv8m.main+cdecp0+cdecp1+cdecp7 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V8M-CDE-MASK1 %s
817 // CHECK-V8M-CDE-MASK1: #define __ARM_FEATURE_CDE 1
818 // CHECK-V8M-CDE-MASK1: #define __ARM_FEATURE_CDE_COPROC 0x83
819 // RUN: %clang -target arm-arm-none-eabi -march=armv8m.main+cdecp0+cdecp1+cdecp2+cdecp3+cdecp4+cdecp5+cdecp6+cdecp7 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V8M-CDE-MASK2 %s
820 // CHECK-V8M-CDE-MASK2: #define __ARM_FEATURE_CDE 1
821 // CHECK-V8M-CDE-MASK2: #define __ARM_FEATURE_CDE_COPROC 0xff
823 // RUN: %clang -target armv8.1a-none-none-eabi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V81A %s
824 // CHECK-V81A: #define __ARM_ARCH 8
825 // CHECK-V81A: #define __ARM_ARCH_8_1A__ 1
826 // CHECK-V81A: #define __ARM_ARCH_PROFILE 'A'
827 // CHECK-V81A: #define __ARM_FEATURE_QRDMX 1
828 // CHECK-V81A: #define __ARM_FP 0xe
830 // RUN: %clang -target armv8.2a-none-none-eabi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V82A %s
831 // CHECK-V82A: #define __ARM_ARCH 8
832 // CHECK-V82A: #define __ARM_ARCH_8_2A__ 1
833 // CHECK-V82A: #define __ARM_ARCH_PROFILE 'A'
834 // CHECK-V82A: #define __ARM_FEATURE_QRDMX 1
835 // CHECK-V82A: #define __ARM_FP 0xe
837 // RUN: %clang -target armv7-apple-driverkit21.0 -x c %s -dM -E -o - | FileCheck -match-full-lines --check-prefix=CHECK-DRIVERKIT %s
838 // CHECK-DRIVERKIT-NOT: #define __ARM_PCS_VFP 1
840 // RUN: %clang -target armv8.3a-none-none-eabi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V83A %s
841 // CHECK-V83A: #define __ARM_ARCH 8
842 // CHECK-V83A: #define __ARM_ARCH_8_3A__ 1
843 // CHECK-V83A: #define __ARM_ARCH_PROFILE 'A'
845 // RUN: %clang -target armv8.4a-none-none-eabi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V84A %s
846 // CHECK-V84A: #define __ARM_ARCH 8
847 // CHECK-V84A: #define __ARM_ARCH_8_4A__ 1
848 // CHECK-V84A: #define __ARM_ARCH_PROFILE 'A'
850 // RUN: %clang -target armv8.5a-none-none-eabi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V85A %s
851 // CHECK-V85A: #define __ARM_ARCH 8
852 // CHECK-V85A: #define __ARM_ARCH_8_5A__ 1
853 // CHECK-V85A: #define __ARM_ARCH_PROFILE 'A'
855 // RUN: %clang -target armv8.6a-none-none-eabi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V86A %s
856 // CHECK-V86A: #define __ARM_ARCH 8
857 // CHECK-V86A: #define __ARM_ARCH_8_6A__ 1
858 // CHECK-V86A: #define __ARM_ARCH_PROFILE 'A'
860 // RUN: %clang -target armv8.7a-none-none-eabi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V87A %s
861 // CHECK-V87A: #define __ARM_ARCH 8
862 // CHECK-V87A: #define __ARM_ARCH_8_7A__ 1
863 // CHECK-V87A: #define __ARM_ARCH_PROFILE 'A'
865 // RUN: %clang -target armv8.8a-none-none-eabi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V88A %s
866 // CHECK-V88A: #define __ARM_ARCH 8
867 // CHECK-V88A: #define __ARM_ARCH_8_8A__ 1
868 // CHECK-V88A: #define __ARM_ARCH_PROFILE 'A'
870 // RUN: %clang -target armv8.9a-none-none-eabi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V89A %s
871 // CHECK-V89A: #define __ARM_ARCH 8
872 // CHECK-V89A: #define __ARM_ARCH_8_9A__ 1
873 // CHECK-V89A: #define __ARM_ARCH_PROFILE 'A'
875 // RUN: %clang -target armv9a-none-none-eabi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V9A %s
876 // CHECK-V9A: #define __ARM_ARCH 9
877 // CHECK-V9A: #define __ARM_ARCH_9A__ 1
878 // CHECK-V9A: #define __ARM_ARCH_PROFILE 'A'
880 // RUN: %clang -target armv9.1a-none-none-eabi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V91A %s
881 // CHECK-V91A: #define __ARM_ARCH 9
882 // CHECK-V91A: #define __ARM_ARCH_9_1A__ 1
883 // CHECK-V91A: #define __ARM_ARCH_PROFILE 'A'
885 // RUN: %clang -target armv9.2a-none-none-eabi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V92A %s
886 // CHECK-V92A: #define __ARM_ARCH 9
887 // CHECK-V92A: #define __ARM_ARCH_9_2A__ 1
888 // CHECK-V92A: #define __ARM_ARCH_PROFILE 'A'
890 // RUN: %clang -target armv9.3a-none-none-eabi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V93A %s
891 // CHECK-V93A: #define __ARM_ARCH 9
892 // CHECK-V93A: #define __ARM_ARCH_9_3A__ 1
893 // CHECK-V93A: #define __ARM_ARCH_PROFILE 'A'
895 // RUN: %clang -target armv9.4a-none-none-eabi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V94A %s
896 // CHECK-V94A: #define __ARM_ARCH 9
897 // CHECK-V94A: #define __ARM_ARCH_9_4A__ 1
898 // CHECK-V94A: #define __ARM_ARCH_PROFILE 'A'
900 // RUN: %clang -target arm-none-none-eabi -march=armv7-m -mfpu=softvfp -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-SOFTVFP %s
901 // CHECK-SOFTVFP-NOT: #define __ARM_FP 0x
903 // Test Armv8.1-M PACBTI
904 // RUN: %clang -target arm-arm-none-eabi -march=armv8.1-m.main -x c -E -dM %s -o - | FileCheck --check-prefixes=CHECK-NOBTI,CHECK-NOPAC %s
905 // RUN: %clang -target arm-arm-none-eabi -march=armv8.1-m.main -mbranch-protection=bti -x c -E -dM %s -o - | FileCheck --check-prefixes=CHECK-BTI,CHECK-NOPAC %s
906 // RUN: %clang -target arm-arm-none-eabi -march=armv8.1-m.main -mbranch-protection=pac-ret -x c -E -dM %s -o - | FileCheck --check-prefixes=CHECK-PAC,CHECK-NOBTI %s
907 // RUN: %clang -target arm-arm-none-eabi -march=armv8.1-m.main -mbranch-protection=pac-ret+b-key -x c -E -dM %s -o - | FileCheck --check-prefixes=CHECK-PAC,CHECK-NOBTI %s
908 // RUN: %clang -target arm-arm-none-eabi -march=armv8.1-m.main -mbranch-protection=pac-ret+leaf -x c -E -dM %s -o - | FileCheck --check-prefixes=CHECK-PAC-LEAF,CHECK-NOBTI %s
909 // RUN: %clang -target arm-arm-none-eabi -march=armv8.1-m.main -mbranch-protection=pac-ret+b-key+leaf -x c -E -dM %s -o - | FileCheck --check-prefixes=CHECK-PAC-LEAF,CHECK-NOBTI %s
910 // RUN: %clang -target arm-arm-none-eabi -march=armv8.1-m.main -mbranch-protection=bti+pac-ret -x c -E -dM %s -o - | FileCheck --check-prefixes=CHECK-PAC,CHECK-BTI %s
911 // RUN: %clang -target arm-arm-none-eabi -march=armv8.1-m.main -mbranch-protection=bti+pac-ret+b-key -x c -E -dM %s -o - | FileCheck --check-prefixes=CHECK-PAC,CHECK-BTI %s
912 // RUN: %clang -target arm-arm-none-eabi -march=armv8.1-m.main -mbranch-protection=bti+pac-ret+leaf -x c -E -dM %s -o - | FileCheck --check-prefixes=CHECK-PAC-LEAF,CHECK-BTI %s
913 // RUN: %clang -target arm-arm-none-eabi -march=armv8.1-m.main -mbranch-protection=bti+pac-ret+b-key+leaf -x c -E -dM %s -o - | FileCheck --check-prefixes=CHECK-PAC-LEAF,CHECK-BTI %s
914 // CHECK-NOBTI-NOT: #define __ARM_FEATURE_BTI_DEFAULT
915 // CHECK-NOPAC-NOT: #define __ARM_FEATURE_PAC_DEFAULT
916 // CHECK-BTI: #define __ARM_FEATURE_BTI_DEFAULT 1
917 // CHECK-PAC: #define __ARM_FEATURE_PAC_DEFAULT 1
918 // CHECK-PAC-LEAF: #define __ARM_FEATURE_PAC_DEFAULT 5
920 // RUN: %clang -target arm-arm-none-eabi -march=armv8.1-m.main -x c -E -dM %s -o - | FileCheck --check-prefixes=CHECK-NOBTI-EXT,CHECK-NOPAC-EXT %s
921 // RUN: %clang -target arm-arm-none-eabi -march=armv7-m+pacbti -x c -E -dM %s -o - | FileCheck --check-prefixes=CHECK-PACBTI-EXT %s
922 // CHECK-NOBTI-EXT-NOT: #define __ARM_FEATURE_BTI 1
923 // CHECK-NOPAC-EXT-NOT: #define __ARM_FEATURE_PAUTH 1
924 // CHECK-PACBTI-EXT: #define __ARM_FEATURE_BTI 1
925 // CHECK-PACBTI-EXT: #define __ARM_FEATURE_PAUTH 1
927 // ================== Check BFloat16 Extensions.
928 // RUN: %clang -target arm-arm-none-eabi -march=armv8.6-a+bf16 -x c -E -dM %s -o - 2>&1 | FileCheck -check-prefix=CHECK-BFLOAT %s
929 // CHECK-BFLOAT: #define __ARM_BF16_FORMAT_ALTERNATIVE 1
930 // CHECK-BFLOAT: #define __ARM_FEATURE_BF16 1
931 // CHECK-BFLOAT: #define __ARM_FEATURE_BF16_VECTOR_ARITHMETIC 1
933 // Check crypto feature test macros
934 // RUN: %clang -target arm-arm-none-eabi -march=armv8-a+crypto -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-CRYPTO %s
935 // CHECK-CRYPTO: #define __ARM_ARCH_PROFILE 'A'
936 // CHECK-CRYPTO: #define __ARM_FEATURE_AES 1
937 // CHECK-CRYPTO: #define __ARM_FEATURE_CRYPTO 1
938 // CHECK-CRYPTO: #define __ARM_FEATURE_SHA2 1
939 // RUN: %clang -target arm-arm-none-eabi -march=armv8-a+nocrypto -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-NOCRYPTO %s
940 // CHECK-NOCRYPTO: #define __ARM_ARCH_PROFILE 'A'
941 // CHECK-NOCRYPTO-NOT: #define __ARM_FEATURE_AES 1
942 // CHECK-NOCRYPTO-NOT: #define __ARM_FEATURE_CRYPTO 1
943 // CHECK-NOCRYPTO-NOT: #define __ARM_FEATURE_SHA2 1
944 // RUN: %clang -target arm-arm-none-eabi -march=armv8-a+aes+nosha2 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-AES %s
945 // CHECK-AES: #define __ARM_ARCH_PROFILE 'A'
946 // CHECK-AES: #define __ARM_FEATURE_AES 1
947 // CHECK-AES-NOT: #define __ARM_FEATURE_CRYPTO 1
948 // CHECK-AES-NOT: #define __ARM_FEATURE_SHA2 1
949 // RUN: %clang -target arm-arm-none-eabi -march=armv8-a+noaes+sha2 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-SHA2 %s
950 // CHECK-SHA2: #define __ARM_ARCH_PROFILE 'A'
951 // CHECK-SHA2-NOT: #define __ARM_FEATURE_AES 1
952 // CHECK-SHA2-NOT: #define __ARM_FEATURE_CRYPTO 1
953 // CHECK-SHA2: #define __ARM_FEATURE_SHA2 1
955 // ================== Check default macros for Armv8.1-A and later
956 // RUN: %clang -target arm-arm-none-eabi -march=armv8.1-a -x c -E -dM %s -o - | FileCheck --check-prefixes=CHECK-V81-OR-LATER,CHECK-BEFORE-V83 %s
957 // RUN: %clang -target arm-arm-none-eabi -march=armv8.2-a -x c -E -dM %s -o - | FileCheck --check-prefixes=CHECK-V81-OR-LATER,CHECK-BEFORE-V83 %s
958 // RUN: %clang -target arm-arm-none-eabi -march=armv8.3-a -x c -E -dM %s -o - | FileCheck --check-prefixes=CHECK-V81-OR-LATER,CHECK-V83-OR-LATER %s
959 // RUN: %clang -target arm-arm-none-eabi -march=armv8.4-a -x c -E -dM %s -o - | FileCheck --check-prefixes=CHECK-V81-OR-LATER,CHECK-V83-OR-LATER %s
960 // RUN: %clang -target arm-arm-none-eabi -march=armv8.5-a -x c -E -dM %s -o - | FileCheck --check-prefixes=CHECK-V81-OR-LATER,CHECK-V83-OR-LATER %s
961 // RUN: %clang -target arm-arm-none-eabi -march=armv8.6-a -x c -E -dM %s -o - | FileCheck --check-prefixes=CHECK-V81-OR-LATER,CHECK-V83-OR-LATER %s
962 // RUN: %clang -target arm-arm-none-eabi -march=armv8.7-a -x c -E -dM %s -o - | FileCheck --check-prefixes=CHECK-V81-OR-LATER,CHECK-V83-OR-LATER %s
963 // RUN: %clang -target arm-arm-none-eabi -march=armv8.8-a -x c -E -dM %s -o - | FileCheck --check-prefixes=CHECK-V81-OR-LATER,CHECK-V83-OR-LATER %s
964 // RUN: %clang -target arm-arm-none-eabi -march=armv9-a -x c -E -dM %s -o - | FileCheck --check-prefixes=CHECK-V81-OR-LATER,CHECK-V83-OR-LATER %s
965 // RUN: %clang -target arm-arm-none-eabi -march=armv9.1-a -x c -E -dM %s -o - | FileCheck --check-prefixes=CHECK-V81-OR-LATER,CHECK-V83-OR-LATER %s
966 // RUN: %clang -target arm-arm-none-eabi -march=armv9.2-a -x c -E -dM %s -o - | FileCheck --check-prefixes=CHECK-V81-OR-LATER,CHECK-V83-OR-LATER %s
967 // RUN: %clang -target arm-arm-none-eabi -march=armv9.3-a -x c -E -dM %s -o - | FileCheck --check-prefixes=CHECK-V81-OR-LATER,CHECK-V83-OR-LATER %s
968 // CHECK-V83-OR-LATER: __ARM_FEATURE_COMPLEX 1
969 // CHECK-V81-OR-LATER: __ARM_FEATURE_QRDMX 1
970 // CHECK-BEFORE-V83-NOT: __ARM_FEATURE_COMPLEX 1