1 // RUN: %clang -target arm-eabi -x c -E -dM %s -o - | FileCheck %s
2 // RUN: %clang -target thumb-eabi -x c -E -dM %s -o - | FileCheck %s
4 // CHECK-NOT: __ARM_64BIT_STATE
5 // CHECK-NOT: __ARM_ARCH_ISA_A64
6 // CHECK-NOT: __ARM_BIG_ENDIAN
7 // CHECK: __ARM_32BIT_STATE 1
8 // CHECK: __ARM_ACLE 200
10 // RUN: %clang -target armeb-eabi -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-BIGENDIAN
11 // RUN: %clang -target thumbeb-eabi -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-BIGENDIAN
13 // CHECK-BIGENDIAN: __ARM_BIG_ENDIAN 1
15 // RUN: %clang -target armv7-none-linux-eabi -mno-unaligned-access -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-UNALIGNED
17 // CHECK-UNALIGNED-NOT: __ARM_FEATURE_UNALIGNED
19 // RUN: %clang -target arm-none-linux-eabi -march=armv4 -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-V4
21 // CHECK-V4-NOT: __ARM_ARCH_ISA_THUMB
22 // CHECK-V4-NOT: __ARM_ARCH_PROFILE
23 // CHECK-V4-NOT: __ARM_FEATURE_CLZ
24 // CHECK-V4-NOT: __ARM_FEATURE_LDREX
25 // CHECK-V4-NOT: __ARM_FEATURE_UNALIGNED
26 // CHECK-V4-NOT: __ARM_FEATURE_DSP
27 // CHECK-V4-NOT: __ARM_FEATURE_SAT
28 // CHECK-V4-NOT: __ARM_FEATURE_QBIT
29 // CHECK-V4-NOT: __ARM_FEATURE_SIMD32
30 // CHECK-V4-NOT: __ARM_FEATURE_IDIV
31 // CHECK-V4: __ARM_ARCH 4
32 // CHECK-V4: __ARM_ARCH_ISA_ARM 1
34 // RUN: %clang -target arm-none-linux-eabi -march=armv4t -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-V4T
36 // CHECK-V4T: __ARM_ARCH_ISA_THUMB 1
38 // RUN: %clang -target arm-none-linux-eabi -march=armv5t -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-V5
40 // CHECK-V5-NOT: __ARM_ARCH_PROFILE
41 // CHECK-V5-NOT: __ARM_FEATURE_LDREX
42 // CHECK-V5-NOT: __ARM_FEATURE_UNALIGNED
43 // CHECK-V5-NOT: __ARM_FEATURE_DSP
44 // CHECK-V5-NOT: __ARM_FEATURE_SAT
45 // CHECK-V5-NOT: __ARM_FEATURE_QBIT
46 // CHECK-V5-NOT: __ARM_FEATURE_SIMD32
47 // CHECK-V5-NOT: __ARM_FEATURE_IDIV
48 // CHECK-V5: __ARM_ARCH 5
49 // CHECK-V5: __ARM_ARCH_ISA_ARM 1
50 // CHECK-V5: __ARM_ARCH_ISA_THUMB 1
51 // CHECK-V5: __ARM_FEATURE_CLZ 1
53 // RUN: %clang -target arm-none-linux-eabi -march=armv5te -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-V5E
55 // CHECK-V5E: __ARM_FEATURE_DSP 1
56 // CHECK-V5E: __ARM_FEATURE_QBIT 1
58 // RUN: %clang -target armv6-none-netbsd-eabi -mcpu=arm1136jf-s -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-V6
60 // CHECK-V6-NOT: __ARM_ARCH_PROFILE
61 // CHECK-V6-NOT: __ARM_FEATURE_IDIV
62 // CHECK-V6: __ARM_ARCH 6
63 // CHECK-V6: __ARM_ARCH_ISA_ARM 1
64 // CHECK-V6: __ARM_ARCH_ISA_THUMB 1
65 // CHECK-V6: __ARM_FEATURE_CLZ 1
66 // CHECK-V6: __ARM_FEATURE_DSP 1
67 // CHECK-V6: __ARM_FEATURE_LDREX 0x4
68 // CHECK-V6: __ARM_FEATURE_QBIT 1
69 // CHECK-V6: __ARM_FEATURE_SAT 1
70 // CHECK-V6: __ARM_FEATURE_SIMD32 1
71 // CHECK-V6: __ARM_FEATURE_UNALIGNED 1
73 // RUN: %clang -target arm-none-linux-eabi -march=armv6m -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-V6M
75 // CHECK-V6M-NOT: __ARM_ARCH_ISA_ARM
76 // CHECK-V6M-NOT: __ARM_FEATURE_CLZ
77 // CHECK-V6M-NOT: __ARM_FEATURE_LDREX
78 // CHECK-V6M-NOT: __ARM_FEATURE_UNALIGNED
79 // CHECK-V6M-NOT: __ARM_FEATURE_DSP
80 // CHECK-V6M-NOT: __ARM_FEATURE_QBIT
81 // CHECK-V6M-NOT: __ARM_FEATURE_SAT
82 // CHECK-V6M-NOT: __ARM_FEATURE_SIMD32
83 // CHECK-V6M-NOT: __ARM_FEATURE_IDIV
84 // CHECK-V6M: __ARM_ARCH 6
85 // CHECK-V6M: __ARM_ARCH_ISA_THUMB 1
86 // CHECK-V6M: __ARM_ARCH_PROFILE 'M'
88 // RUN: %clang -target arm-none-linux-eabi -march=armv6t2 -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-V6T2
90 // CHECK-V6T2: __ARM_ARCH_ISA_THUMB 2
92 // RUN: %clang -target arm-none-linux-eabi -march=armv6k -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-V6K
94 // CHECK-V6K: __ARM_FEATURE_LDREX 0xf
96 // RUN: %clang -target arm-none-linux-eabi -march=armv7-a -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-V7A
98 // CHECK-V7A: __ARM_ARCH 7
99 // CHECK-V7A: __ARM_ARCH_ISA_ARM 1
100 // CHECK-V7A: __ARM_ARCH_ISA_THUMB 2
101 // CHECK-V7A: __ARM_ARCH_PROFILE 'A'
102 // CHECK-V7A: __ARM_FEATURE_CLZ 1
103 // CHECK-V7A: __ARM_FEATURE_DSP 1
104 // CHECK-V7A: __ARM_FEATURE_LDREX 0xf
105 // CHECK-V7A: __ARM_FEATURE_QBIT 1
106 // CHECK-V7A: __ARM_FEATURE_SAT 1
107 // CHECK-V7A: __ARM_FEATURE_SIMD32 1
108 // CHECK-V7A: __ARM_FEATURE_UNALIGNED 1
110 // RUN: %clang -target arm-none-linux-eabi -mcpu=cortex-a7 -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-V7A-IDIV
111 // RUN: %clang -target arm-none-linux-eabi -mcpu=cortex-a12 -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-V7A-IDIV
112 // RUN: %clang -target arm-none-linux-eabi -mcpu=cortex-a15 -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-V7A-IDIV
113 // RUN: %clang -target arm-none-linux-eabi -mcpu=cortex-a17 -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-V7A-IDIV
115 // CHECK-V7A-IDIV: __ARM_FEATURE_IDIV 1
117 // RUN: %clang -target arm-none-linux-eabi -mcpu=cortex-a5 -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-V7A-NO-IDIV
118 // RUN: %clang -target arm-none-linux-eabi -mcpu=cortex-a8 -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-V7A-NO-IDIV
119 // RUN: %clang -target arm-none-linux-eabi -mcpu=cortex-a9 -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-V7A-NO-IDIV
121 // CHECK-V7A-NO-IDIV-NOT: __ARM_FEATURE_IDIV
123 // RUN: %clang -target arm-none-linux-eabi -march=armv7ve -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-V7VE
125 // CHECK-V7VE: __ARM_ARCH 7
126 // CHECK-V7VE: __ARM_ARCH_ISA_ARM 1
127 // CHECK-V7VE: __ARM_ARCH_ISA_THUMB 2
128 // CHECK-V7VE: __ARM_ARCH_PROFILE 'A'
129 // CHECK-V7VE: __ARM_FEATURE_CLZ 1
130 // CHECK-V7VE: __ARM_FEATURE_DSP 1
131 // CHECK-V7VE: __ARM_FEATURE_IDIV 1
132 // CHECK-V7VE: __ARM_FEATURE_LDREX 0xf
133 // CHECK-V7VE: __ARM_FEATURE_QBIT 1
134 // CHECK-V7VE: __ARM_FEATURE_SAT 1
135 // CHECK-V7VE: __ARM_FEATURE_SIMD32 1
136 // CHECK-V7VE: __ARM_FEATURE_UNALIGNED 1
138 // RUN: %clang -target arm-none-linux-eabi -march=armv7-r -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-V7R
140 // CHECK-V7R: __ARM_ARCH 7
141 // CHECK-V7R: __ARM_ARCH_ISA_ARM 1
142 // CHECK-V7R: __ARM_ARCH_ISA_THUMB 2
143 // CHECK-V7R: __ARM_ARCH_PROFILE 'R'
144 // CHECK-V7R: __ARM_FEATURE_CLZ 1
145 // CHECK-V7R: __ARM_FEATURE_DSP 1
146 // CHECK-V7R: __ARM_FEATURE_LDREX 0xf
147 // CHECK-V7R: __ARM_FEATURE_QBIT 1
148 // CHECK-V7R: __ARM_FEATURE_SAT 1
149 // CHECK-V7R: __ARM_FEATURE_SIMD32 1
150 // CHECK-V7R: __ARM_FEATURE_UNALIGNED 1
152 // RUN: %clang -target arm-none-linux-eabi -mcpu=cortex-r4 -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-V7R-NO-IDIV
154 // CHECK-V7R-NO-IDIV-NOT: __ARM_FEATURE_IDIV
156 // RUN: %clang -target arm-none-linux-eabi -mcpu=cortex-r5 -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-V7R-IDIV
157 // RUN: %clang -target arm-none-linux-eabi -mcpu=cortex-r7 -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-V7R-IDIV
158 // RUN: %clang -target arm-none-linux-eabi -mcpu=cortex-r8 -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-V7R-IDIV
160 // CHECK-V7R-IDIV: __ARM_FEATURE_IDIV 1
162 // RUN: %clang -target arm-none-linux-eabi -march=armv7-m -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-V7M
164 // CHECK-V7M-NOT: __ARM_ARCH_ISA_ARM
165 // CHECK-V7M-NOT: __ARM_FEATURE_DSP
166 // CHECK-V7M-NOT: __ARM_FEATURE_SIMD32
167 // CHECK-V7M: __ARM_ARCH 7
168 // CHECK-V7M: __ARM_ARCH_ISA_THUMB 2
169 // CHECK-V7M: __ARM_ARCH_PROFILE 'M'
170 // CHECK-V7M: __ARM_FEATURE_CLZ 1
171 // CHECK-V7M: __ARM_FEATURE_IDIV 1
172 // CHECK-V7M: __ARM_FEATURE_LDREX 0x7
173 // CHECK-V7M: __ARM_FEATURE_QBIT 1
174 // CHECK-V7M: __ARM_FEATURE_SAT 1
175 // CHECK-V7M: __ARM_FEATURE_UNALIGNED 1
177 // RUN: %clang -target arm-none-linux-eabi -march=armv7-m -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-M-NODSP
178 // RUN: %clang -target arm-none-linux-eabi -march=armv7e-m -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-M-DSP
179 // RUN: %clang --target=arm-arm-none-eabi -mcpu=cortex-m3 -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-M-NODSP
180 // RUN: %clang --target=arm-arm-none-eabi -mcpu=cortex-m4 -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-M-DSP
181 // RUN: %clang --target=arm-arm-none-eabi -mcpu=cortex-m7 -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-M-DSP
182 // RUN: %clang --target=arm-arm-none-eabi -mcpu=cortex-m0plus -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-M-NODSP
183 // RUN: %clang --target=arm-arm-none-eabi -mcpu=cortex-m23 -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-M-NODSP
184 // RUN: %clang --target=arm-arm-none-eabi -mcpu=cortex-m33 -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-M-DSP
185 // RUN: %clang --target=arm-arm-none-eabi -march=armv8m.main+dsp -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-M-DSP
187 // CHECK-M-DSP: __ARM_FEATURE_DSP 1
188 // CHECK-M-DSP: __ARM_FEATURE_SIMD32 1
190 // CHECK-M-NODSP-NOT: __ARM_FEATURE_DSP 1
191 // CHECK-M-NODSP-NOT: __ARM_FEATURE_SIMD32 1
193 // RUN: %clang -target arm-none-linux-eabi -march=armv8-a -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-V8A
195 // CHECK-V8A: __ARM_ARCH 8
196 // CHECK-V8A: __ARM_ARCH_ISA_ARM 1
197 // CHECK-V8A: __ARM_ARCH_ISA_THUMB 2
198 // CHECK-V8A: __ARM_ARCH_PROFILE 'A'
199 // CHECK-V8A: __ARM_FEATURE_CLZ 1
200 // CHECK-V8A: __ARM_FEATURE_DSP 1
201 // CHECK-V8A: __ARM_FEATURE_IDIV 1
202 // CHECK-V8A: __ARM_FEATURE_LDREX 0xf
203 // CHECK-V8A: __ARM_FEATURE_QBIT 1
204 // CHECK-V8A: __ARM_FEATURE_SAT 1
205 // CHECK-V8A: __ARM_FEATURE_SIMD32 1
206 // CHECK-V8A: __ARM_FEATURE_UNALIGNED 1