xref: /minix3/external/bsd/llvm/dist/clang/test/Preprocessor/arm-target-features.c (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1f4a2713aSLionel Sambuc // RUN: %clang -target armv8a-none-linux-gnu -x c -E -dM %s -o - | FileCheck %s
2f4a2713aSLionel Sambuc // CHECK: __ARMEL__ 1
3f4a2713aSLionel Sambuc // CHECK: __ARM_ARCH 8
4f4a2713aSLionel Sambuc // CHECK: __ARM_ARCH_8A__ 1
5f4a2713aSLionel Sambuc // CHECK: __ARM_FEATURE_CRC32 1
6*0a6a1f1dSLionel Sambuc // CHECK: __ARM_FEATURE_DIRECTED_ROUNDING 1
7*0a6a1f1dSLionel Sambuc // CHECK: __ARM_FEATURE_NUMERIC_MAXMIN 1
8f4a2713aSLionel Sambuc 
9f4a2713aSLionel Sambuc // RUN: %clang -target armv7a-none-linux-gnu -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-V7 %s
10f4a2713aSLionel Sambuc // CHECK-V7: __ARMEL__ 1
11f4a2713aSLionel Sambuc // CHECK-V7: __ARM_ARCH 7
12f4a2713aSLionel Sambuc // CHECK-V7: __ARM_ARCH_7A__ 1
13*0a6a1f1dSLionel Sambuc // CHECK-V7-NOT: __ARM_FEATURE_CRC32
14*0a6a1f1dSLionel Sambuc // CHECK-V7-NOT: __ARM_FEATURE_NUMERIC_MAXMIN
15*0a6a1f1dSLionel Sambuc // CHECK-V7-NOT: __ARM_FEATURE_DIRECTED_ROUNDING
16f4a2713aSLionel Sambuc 
17f4a2713aSLionel Sambuc // RUN: %clang -target armv8a -mfloat-abi=hard -x c -E -dM %s | FileCheck --check-prefix=CHECK-V8-BAREHF %s
18f4a2713aSLionel Sambuc // CHECK-V8-BAREHF: __ARMEL__ 1
19f4a2713aSLionel Sambuc // CHECK-V8-BAREHF: __ARM_ARCH 8
20f4a2713aSLionel Sambuc // CHECK-V8-BAREHF: __ARM_ARCH_8A__ 1
21f4a2713aSLionel Sambuc // CHECK-V8-BAREHF: __ARM_FEATURE_CRC32 1
22*0a6a1f1dSLionel Sambuc // CHECK-V8-BAREHF: __ARM_FEATURE_DIRECTED_ROUNDING 1
23*0a6a1f1dSLionel Sambuc // CHECK-V8-BAREHF: __ARM_FEATURE_NUMERIC_MAXMIN 1
24f4a2713aSLionel Sambuc // CHECK-V8-BAREHF: __ARM_NEON__ 1
25f4a2713aSLionel Sambuc // CHECK-V8-BAREHF: __VFP_FP__ 1
26f4a2713aSLionel Sambuc 
27f4a2713aSLionel Sambuc // RUN: %clang -target armv8a -mfloat-abi=hard -mfpu=fp-armv8 -x c -E -dM %s | FileCheck --check-prefix=CHECK-V8-BAREHF-FP %s
28f4a2713aSLionel Sambuc // CHECK-V8-BAREHF-FP-NOT: __ARM_NEON__ 1
29f4a2713aSLionel Sambuc // CHECK-V8-BAREHF-FP: __VFP_FP__ 1
30f4a2713aSLionel Sambuc 
31f4a2713aSLionel Sambuc // RUN: %clang -target armv8a -mfloat-abi=hard -mfpu=neon-fp-armv8 -x c -E -dM %s | FileCheck --check-prefix=CHECK-V8-BAREHF-NEON-FP %s
32f4a2713aSLionel Sambuc // RUN: %clang -target armv8a -mfloat-abi=hard -mfpu=crypto-neon-fp-armv8 -x c -E -dM %s | FileCheck --check-prefix=CHECK-V8-BAREHF-NEON-FP %s
33f4a2713aSLionel Sambuc // CHECK-V8-BAREHF-NEON-FP: __ARM_NEON__ 1
34f4a2713aSLionel Sambuc // CHECK-V8-BAREHF-NEON-FP: __VFP_FP__ 1
35f4a2713aSLionel Sambuc 
36f4a2713aSLionel Sambuc // RUN: %clang -target armv8a -mnocrc -x c -E -dM %s | FileCheck --check-prefix=CHECK-V8-NOCRC %s
37f4a2713aSLionel Sambuc // CHECK-V8-NOCRC-NOT: __ARM_FEATURE_CRC32 1
38f4a2713aSLionel Sambuc 
39f4a2713aSLionel Sambuc // Check that -mhwdiv works properly for armv8/thumbv8 (enabled by default).
40f4a2713aSLionel Sambuc 
41f4a2713aSLionel Sambuc // RUN: %clang -target armv8 -x c -E -dM %s -o - | FileCheck --check-prefix=ARMV8 %s
42f4a2713aSLionel Sambuc // ARMV8:#define __ARM_ARCH_EXT_IDIV__ 1
43f4a2713aSLionel Sambuc 
44f4a2713aSLionel Sambuc // RUN: %clang -target armv8 -mthumb -x c -E -dM %s -o - | FileCheck --check-prefix=THUMBV8 %s
45f4a2713aSLionel Sambuc // THUMBV8:#define __ARM_ARCH_EXT_IDIV__ 1
46f4a2713aSLionel Sambuc 
47f4a2713aSLionel Sambuc // RUN: %clang -target armv8-eabi -x c -E -dM %s -o - | FileCheck --check-prefix=ARMV8-EABI %s
48f4a2713aSLionel Sambuc // ARMV8-EABI:#define __ARM_ARCH_EXT_IDIV__ 1
49f4a2713aSLionel Sambuc 
50f4a2713aSLionel Sambuc // RUN: %clang -target armv8-eabi -mthumb -x c -E -dM %s -o - | FileCheck --check-prefix=THUMBV8-EABI %s
51f4a2713aSLionel Sambuc // THUMBV8-EABI:#define __ARM_ARCH_EXT_IDIV__ 1
52f4a2713aSLionel Sambuc 
53f4a2713aSLionel Sambuc // RUN: %clang -target armv8 -mhwdiv=none -x c -E -dM %s -o - | FileCheck --check-prefix=NONEHWDIV-ARMV8 %s
54f4a2713aSLionel Sambuc // NONEHWDIV-ARMV8-NOT:#define __ARM_ARCH_EXT_IDIV__
55f4a2713aSLionel Sambuc 
56f4a2713aSLionel Sambuc // RUN: %clang -target armv8 -mthumb -mhwdiv=none -x c -E -dM %s -o - | FileCheck --check-prefix=NONEHWDIV-THUMBV8 %s
57f4a2713aSLionel Sambuc // NONEHWDIV-THUMBV8-NOT:#define __ARM_ARCH_EXT_IDIV__
58f4a2713aSLionel Sambuc 
59f4a2713aSLionel Sambuc // RUN: %clang -target armv8 -mhwdiv=thumb -x c -E -dM %s -o - | FileCheck --check-prefix=THUMBHWDIV-ARMV8 %s
60f4a2713aSLionel Sambuc // THUMBHWDIV-ARMV8-NOT:#define __ARM_ARCH_EXT_IDIV__
61f4a2713aSLionel Sambuc 
62f4a2713aSLionel Sambuc // RUN: %clang -target armv8 -mthumb -mhwdiv=arm -x c -E -dM %s -o - | FileCheck --check-prefix=ARMHWDIV-THUMBV8 %s
63f4a2713aSLionel Sambuc // ARMHWDIV-THUMBV8-NOT:#define __ARM_ARCH_EXT_IDIV__
64f4a2713aSLionel Sambuc 
65f4a2713aSLionel Sambuc // RUN: %clang -target armv8a -x c -E -dM %s -o - | FileCheck --check-prefix=ARMV8A %s
66f4a2713aSLionel Sambuc // ARMV8A:#define __ARM_ARCH_EXT_IDIV__ 1
67f4a2713aSLionel Sambuc 
68f4a2713aSLionel Sambuc // RUN: %clang -target armv8a -mthumb -x c -E -dM %s -o - | FileCheck --check-prefix=THUMBV8A %s
69f4a2713aSLionel Sambuc // THUMBV8A:#define __ARM_ARCH_EXT_IDIV__ 1
70f4a2713aSLionel Sambuc 
71f4a2713aSLionel Sambuc // RUN: %clang -target armv8a-eabi -x c -E -dM %s -o - | FileCheck --check-prefix=ARMV8A-EABI %s
72f4a2713aSLionel Sambuc // ARMV8A-EABI:#define __ARM_ARCH_EXT_IDIV__ 1
73f4a2713aSLionel Sambuc 
74f4a2713aSLionel Sambuc // RUN: %clang -target armv8a-eabi -x c -E -dM %s -o - | FileCheck --check-prefix=THUMBV8A-EABI %s
75f4a2713aSLionel Sambuc // THUMBV8A-EABI:#define __ARM_ARCH_EXT_IDIV__ 1
76f4a2713aSLionel Sambuc 
77*0a6a1f1dSLionel Sambuc // RUN: %clang -target arm-none-linux-gnu -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-DEFS %s
78*0a6a1f1dSLionel Sambuc // CHECK-DEFS:#define __ARM_SIZEOF_MINIMAL_ENUM 4
79*0a6a1f1dSLionel Sambuc // CHECK-DEFS:#define __ARM_SIZEOF_WCHAR_T 4
80*0a6a1f1dSLionel Sambuc 
81*0a6a1f1dSLionel Sambuc // RUN: %clang -target arm-none-linux-gnu -fshort-wchar -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-SHORTWCHAR %s
82*0a6a1f1dSLionel Sambuc // CHECK-SHORTWCHAR:#define __ARM_SIZEOF_WCHAR_T 2
83*0a6a1f1dSLionel Sambuc 
84*0a6a1f1dSLionel Sambuc // RUN: %clang -target arm-none-linux-gnu -fshort-enums -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-SHORTENUMS %s
85*0a6a1f1dSLionel Sambuc // CHECK-SHORTENUMS:#define __ARM_SIZEOF_MINIMAL_ENUM 1
86f4a2713aSLionel Sambuc 
87f4a2713aSLionel Sambuc // Test that -mhwdiv has the right effect for a target CPU which has hwdiv enabled by default.
88f4a2713aSLionel Sambuc // RUN: %clang -target armv7 -mcpu=cortex-a15 -x c -E -dM %s -o - | FileCheck --check-prefix=DEFAULTHWDIV-ARM %s
89f4a2713aSLionel Sambuc // DEFAULTHWDIV-ARM:#define __ARM_ARCH_EXT_IDIV__ 1
90f4a2713aSLionel Sambuc 
91f4a2713aSLionel Sambuc // RUN: %clang -target armv7 -mthumb -mcpu=cortex-a15 -x c -E -dM %s -o - | FileCheck --check-prefix=DEFAULTHWDIV-THUMB %s
92f4a2713aSLionel Sambuc // DEFAULTHWDIV-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
93f4a2713aSLionel Sambuc 
94f4a2713aSLionel Sambuc // RUN: %clang -target armv7 -mcpu=cortex-a15 -mhwdiv=arm -x c -E -dM %s -o - | FileCheck --check-prefix=ARMHWDIV-ARM %s
95f4a2713aSLionel Sambuc // ARMHWDIV-ARM:#define __ARM_ARCH_EXT_IDIV__ 1
96f4a2713aSLionel Sambuc 
97f4a2713aSLionel Sambuc // RUN: %clang -target armv7 -mthumb -mcpu=cortex-a15 -mhwdiv=thumb -x c -E -dM %s -o - | FileCheck --check-prefix=THUMBHWDIV-THUMB %s
98f4a2713aSLionel Sambuc // THUMBHWDIV-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
99f4a2713aSLionel Sambuc 
100f4a2713aSLionel Sambuc // RUN: %clang -target arm -mcpu=cortex-a15 -mhwdiv=thumb -x c -E -dM %s -o - | FileCheck --check-prefix=DEFAULTHWDIV-THUMBHWDIV-ARM %s
101f4a2713aSLionel Sambuc // DEFAULTHWDIV-THUMBHWDIV-ARM-NOT:#define __ARM_ARCH_EXT_IDIV__
102f4a2713aSLionel Sambuc 
103f4a2713aSLionel Sambuc // RUN: %clang -target arm -mthumb -mcpu=cortex-a15 -mhwdiv=arm -x c -E -dM %s -o - | FileCheck --check-prefix=DEFAULTHWDIV-ARMHWDIV-THUMB %s
104f4a2713aSLionel Sambuc // DEFAULTHWDIV-ARMHWDIV-THUMB-NOT:#define __ARM_ARCH_EXT_IDIV__
105f4a2713aSLionel Sambuc 
106f4a2713aSLionel Sambuc // RUN: %clang -target arm -mcpu=cortex-a15 -mhwdiv=none -x c -E -dM %s -o - | FileCheck --check-prefix=DEFAULTHWDIV-NONEHWDIV-ARM %s
107f4a2713aSLionel Sambuc // DEFAULTHWDIV-NONEHWDIV-ARM-NOT:#define __ARM_ARCH_EXT_IDIV__
108f4a2713aSLionel Sambuc 
109f4a2713aSLionel Sambuc // RUN: %clang -target arm -mthumb -mcpu=cortex-a15 -mhwdiv=none -x c -E -dM %s -o - | FileCheck --check-prefix=DEFAULTHWDIV-NONEHWDIV-THUMB %s
110f4a2713aSLionel Sambuc // DEFAULTHWDIV-NONEHWDIV-THUMB-NOT:#define __ARM_ARCH_EXT_IDIV__
111f4a2713aSLionel Sambuc 
112*0a6a1f1dSLionel Sambuc 
113*0a6a1f1dSLionel Sambuc // Check that -mfpu works properly for Cortex-A7 (enabled by default).
114*0a6a1f1dSLionel Sambuc // RUN: %clang -target armv7-none-linux-gnueabi -mcpu=cortex-a7 -x c -E -dM %s -o - | FileCheck --check-prefix=DEFAULTFPU-A7 %s
115*0a6a1f1dSLionel Sambuc // RUN: %clang -target armv7-none-linux-gnueabi -mthumb -mcpu=cortex-a7 -x c -E -dM %s -o - | FileCheck --check-prefix=DEFAULTFPU-A7 %s
116*0a6a1f1dSLionel Sambuc // DEFAULTFPU-A7:#define __ARM_NEON__ 1
117*0a6a1f1dSLionel Sambuc // DEFAULTFPU-A7:#define __ARM_VFPV4__ 1
118*0a6a1f1dSLionel Sambuc 
119*0a6a1f1dSLionel Sambuc // RUN: %clang -target armv7-none-linux-gnueabi -mcpu=cortex-a7 -mfpu=none -x c -E -dM %s -o - | FileCheck --check-prefix=FPUNONE-A7 %s
120*0a6a1f1dSLionel Sambuc // RUN: %clang -target armv7-none-linux-gnueabi -mthumb -mcpu=cortex-a7 -mfpu=none -x c -E -dM %s -o - | FileCheck --check-prefix=FPUNONE-A7 %s
121*0a6a1f1dSLionel Sambuc // FPUNONE-A7-NOT:#define __ARM_NEON__ 1
122*0a6a1f1dSLionel Sambuc // FPUNONE-A7-NOT:#define __ARM_VFPV4__ 1
123*0a6a1f1dSLionel Sambuc 
124*0a6a1f1dSLionel Sambuc // RUN: %clang -target armv7-none-linux-gnueabi -mcpu=cortex-a7 -mfpu=vfp4 -x c -E -dM %s -o - | FileCheck --check-prefix=NONEON-A7 %s
125*0a6a1f1dSLionel Sambuc // RUN: %clang -target armv7-none-linux-gnueabi -mthumb -mcpu=cortex-a7 -mfpu=vfp4 -x c -E -dM %s -o - | FileCheck --check-prefix=NONEON-A7 %s
126*0a6a1f1dSLionel Sambuc // NONEON-A7-NOT:#define __ARM_NEON__ 1
127*0a6a1f1dSLionel Sambuc // NONEON-A7:#define __ARM_VFPV4__ 1
128*0a6a1f1dSLionel Sambuc 
129*0a6a1f1dSLionel Sambuc // Check that -mfpu works properly for Cortex-A5 (enabled by default).
130*0a6a1f1dSLionel Sambuc // RUN: %clang -target armv7-none-linux-gnueabi -mcpu=cortex-a5 -x c -E -dM %s -o - | FileCheck --check-prefix=DEFAULTFPU-A5 %s
131*0a6a1f1dSLionel Sambuc // RUN: %clang -target armv7-none-linux-gnueabi -mthumb -mcpu=cortex-a5 -x c -E -dM %s -o - | FileCheck --check-prefix=DEFAULTFPU-A5 %s
132*0a6a1f1dSLionel Sambuc // DEFAULTFPU-A5:#define __ARM_NEON__ 1
133*0a6a1f1dSLionel Sambuc // DEFAULTFPU-A5:#define __ARM_VFPV4__ 1
134*0a6a1f1dSLionel Sambuc 
135*0a6a1f1dSLionel Sambuc // RUN: %clang -target armv7-none-linux-gnueabi -mcpu=cortex-a5 -mfpu=none -x c -E -dM %s -o - | FileCheck --check-prefix=FPUNONE-A5 %s
136*0a6a1f1dSLionel Sambuc // RUN: %clang -target armv7-none-linux-gnueabi -mthumb -mcpu=cortex-a5 -mfpu=none -x c -E -dM %s -o - | FileCheck --check-prefix=FPUNONE-A5 %s
137*0a6a1f1dSLionel Sambuc // FPUNONE-A5-NOT:#define __ARM_NEON__ 1
138*0a6a1f1dSLionel Sambuc // FPUNONE-A5-NOT:#define __ARM_VFPV4__ 1
139*0a6a1f1dSLionel Sambuc 
140*0a6a1f1dSLionel Sambuc // RUN: %clang -target armv7-none-linux-gnueabi -mcpu=cortex-a5 -mfpu=vfp3-d16 -x c -E -dM %s -o - | FileCheck --check-prefix=NONEON-A5 %s
141*0a6a1f1dSLionel Sambuc // RUN: %clang -target armv7-none-linux-gnueabi -mthumb -mcpu=cortex-a5 -mfpu=vfp3-d16 -x c -E -dM %s -o - | FileCheck --check-prefix=NONEON-A5 %s
142*0a6a1f1dSLionel Sambuc // NONEON-A5-NOT:#define __ARM_NEON__ 1
143*0a6a1f1dSLionel Sambuc // NONEON-A5:#define __ARM_VFPV4__ 1
144*0a6a1f1dSLionel Sambuc 
145f4a2713aSLionel Sambuc // FIXME: add check for further predefines
146*0a6a1f1dSLionel Sambuc // Test whether predefines are as expected when targeting ep9312.
147*0a6a1f1dSLionel Sambuc // RUN: %clang -target armv4t -mcpu=ep9312 -x c -E -dM %s -o - | FileCheck --check-prefix=A4T %s
148*0a6a1f1dSLionel Sambuc // A4T-NOT:#define __ARM_FEATURE_DSP
149*0a6a1f1dSLionel Sambuc 
150*0a6a1f1dSLionel Sambuc // Test whether predefines are as expected when targeting arm10tdmi.
151*0a6a1f1dSLionel Sambuc // RUN: %clang -target armv5 -mcpu=arm10tdmi -x c -E -dM %s -o - | FileCheck --check-prefix=A5T %s
152*0a6a1f1dSLionel Sambuc // A5T-NOT:#define __ARM_FEATURE_DSP
153*0a6a1f1dSLionel Sambuc 
154f4a2713aSLionel Sambuc // Test whether predefines are as expected when targeting cortex-a5.
155f4a2713aSLionel Sambuc // RUN: %clang -target armv7 -mcpu=cortex-a5 -x c -E -dM %s -o - | FileCheck --check-prefix=A5-ARM %s
156f4a2713aSLionel Sambuc // A5-ARM-NOT:#define __ARM_ARCH_EXT_IDIV__
157*0a6a1f1dSLionel Sambuc // A5-ARM:#define __ARM_FEATURE_DSP
158f4a2713aSLionel Sambuc 
159f4a2713aSLionel Sambuc // RUN: %clang -target armv7 -mthumb -mcpu=cortex-a5 -x c -E -dM %s -o - | FileCheck --check-prefix=A5-THUMB %s
160f4a2713aSLionel Sambuc // A5-THUMB-NOT:#define __ARM_ARCH_EXT_IDIV__
161*0a6a1f1dSLionel Sambuc // A5-THUMB:#define __ARM_FEATURE_DSP
162*0a6a1f1dSLionel Sambuc 
163*0a6a1f1dSLionel Sambuc // RUN: %clang -target armv7 -mcpu=cortex-a5 -x c -E -dM %s -o - | FileCheck --check-prefix=A5 %s
164*0a6a1f1dSLionel Sambuc // RUN: %clang -target armv7 -mthumb -mcpu=cortex-a5 -x c -E -dM %s -o - | FileCheck --check-prefix=A5 %s
165*0a6a1f1dSLionel Sambuc // A5:#define __ARM_ARCH 7
166*0a6a1f1dSLionel Sambuc // A5:#define __ARM_ARCH_7A__ 1
167*0a6a1f1dSLionel Sambuc // A5:#define __ARM_ARCH_PROFILE 'A'
168*0a6a1f1dSLionel Sambuc // A5-NOT: #define __ARM_FEATURE_NUMERIC_MAXMIN
169*0a6a1f1dSLionel Sambuc // A5-NOT: #define __ARM_FEATURE_DIRECTED_ROUNDING
170*0a6a1f1dSLionel Sambuc // A5:#define __ARM_FEATURE_DSP
171*0a6a1f1dSLionel Sambuc 
172*0a6a1f1dSLionel Sambuc // Test whether predefines are as expected when targeting cortex-a7.
173*0a6a1f1dSLionel Sambuc // RUN: %clang -target armv7 -mcpu=cortex-a7 -x c -E -dM %s -o - | FileCheck --check-prefix=A7 %s
174*0a6a1f1dSLionel Sambuc // RUN: %clang -target armv7 -mthumb -mcpu=cortex-a7 -x c -E -dM %s -o - | FileCheck --check-prefix=A7 %s
175*0a6a1f1dSLionel Sambuc // A7:#define __ARM_ARCH 7
176*0a6a1f1dSLionel Sambuc // A7:#define __ARM_ARCH_7A__ 1
177*0a6a1f1dSLionel Sambuc // A7:#define __ARM_ARCH_EXT_IDIV__ 1
178*0a6a1f1dSLionel Sambuc // A7:#define __ARM_ARCH_PROFILE 'A'
179*0a6a1f1dSLionel Sambuc // A7:#define __ARM_FEATURE_DSP
180f4a2713aSLionel Sambuc 
181f4a2713aSLionel Sambuc // Test whether predefines are as expected when targeting cortex-a8.
182f4a2713aSLionel Sambuc // RUN: %clang -target armv7 -mcpu=cortex-a8 -x c -E -dM %s -o - | FileCheck --check-prefix=A8-ARM %s
183f4a2713aSLionel Sambuc // A8-ARM-NOT:#define __ARM_ARCH_EXT_IDIV__
184*0a6a1f1dSLionel Sambuc // A8-ARM:#define __ARM_FEATURE_DSP
185f4a2713aSLionel Sambuc 
186f4a2713aSLionel Sambuc // RUN: %clang -target armv7 -mthumb -mcpu=cortex-a8 -x c -E -dM %s -o - | FileCheck --check-prefix=A8-THUMB %s
187f4a2713aSLionel Sambuc // A8-THUMB-NOT:#define __ARM_ARCH_EXT_IDIV__
188*0a6a1f1dSLionel Sambuc // A8-THUMB:#define __ARM_FEATURE_DSP
189f4a2713aSLionel Sambuc 
190f4a2713aSLionel Sambuc // Test whether predefines are as expected when targeting cortex-a9.
191f4a2713aSLionel Sambuc // RUN: %clang -target armv7 -mcpu=cortex-a9 -x c -E -dM %s -o - | FileCheck --check-prefix=A9-ARM %s
192f4a2713aSLionel Sambuc // A9-ARM-NOT:#define __ARM_ARCH_EXT_IDIV__
193*0a6a1f1dSLionel Sambuc // A9-ARM:#define __ARM_FEATURE_DSP
194f4a2713aSLionel Sambuc 
195f4a2713aSLionel Sambuc // RUN: %clang -target armv7 -mthumb -mcpu=cortex-a9 -x c -E -dM %s -o - | FileCheck --check-prefix=A9-THUMB %s
196f4a2713aSLionel Sambuc // A9-THUMB-NOT:#define __ARM_ARCH_EXT_IDIV__
197*0a6a1f1dSLionel Sambuc // A9-THUMB:#define __ARM_FEATURE_DSP
198*0a6a1f1dSLionel Sambuc 
199*0a6a1f1dSLionel Sambuc 
200*0a6a1f1dSLionel Sambuc // Check that -mfpu works properly for Cortex-A12 (enabled by default).
201*0a6a1f1dSLionel Sambuc // RUN: %clang -target armv7-none-linux-gnueabi -mcpu=cortex-a12 -x c -E -dM %s -o - | FileCheck --check-prefix=DEFAULTFPU-A12 %s
202*0a6a1f1dSLionel Sambuc // RUN: %clang -target armv7-none-linux-gnueabi -mthumb -mcpu=cortex-a12 -x c -E -dM %s -o - | FileCheck --check-prefix=DEFAULTFPU-A12 %s
203*0a6a1f1dSLionel Sambuc // DEFAULTFPU-A12:#define __ARM_NEON__ 1
204*0a6a1f1dSLionel Sambuc // DEFAULTFPU-A12:#define __ARM_VFPV4__ 1
205*0a6a1f1dSLionel Sambuc 
206*0a6a1f1dSLionel Sambuc // RUN: %clang -target armv7-none-linux-gnueabi -mcpu=cortex-a12 -mfpu=none -x c -E -dM %s -o - | FileCheck --check-prefix=FPUNONE-A12 %s
207*0a6a1f1dSLionel Sambuc // RUN: %clang -target armv7-none-linux-gnueabi -mthumb -mcpu=cortex-a12 -mfpu=none -x c -E -dM %s -o - | FileCheck --check-prefix=FPUNONE-A12 %s
208*0a6a1f1dSLionel Sambuc // FPUNONE-A12-NOT:#define __ARM_NEON__ 1
209*0a6a1f1dSLionel Sambuc // FPUNONE-A12-NOT:#define __ARM_VFPV4__ 1
210*0a6a1f1dSLionel Sambuc 
211*0a6a1f1dSLionel Sambuc // Test whether predefines are as expected when targeting cortex-a12.
212*0a6a1f1dSLionel Sambuc // RUN: %clang -target armv7 -mcpu=cortex-a12 -x c -E -dM %s -o - | FileCheck --check-prefix=A12 %s
213*0a6a1f1dSLionel Sambuc // RUN: %clang -target armv7 -mthumb -mcpu=cortex-a12 -x c -E -dM %s -o - | FileCheck --check-prefix=A12 %s
214*0a6a1f1dSLionel Sambuc // A12:#define __ARM_ARCH 7
215*0a6a1f1dSLionel Sambuc // A12:#define __ARM_ARCH_7A__ 1
216*0a6a1f1dSLionel Sambuc // A12:#define __ARM_ARCH_EXT_IDIV__ 1
217*0a6a1f1dSLionel Sambuc // A12:#define __ARM_ARCH_PROFILE 'A'
218*0a6a1f1dSLionel Sambuc // A12:#define __ARM_FEATURE_DSP
219f4a2713aSLionel Sambuc 
220f4a2713aSLionel Sambuc // Test whether predefines are as expected when targeting cortex-a15.
221f4a2713aSLionel Sambuc // RUN: %clang -target armv7 -mcpu=cortex-a15 -x c -E -dM %s -o - | FileCheck --check-prefix=A15-ARM %s
222f4a2713aSLionel Sambuc // A15-ARM:#define __ARM_ARCH_EXT_IDIV__ 1
223*0a6a1f1dSLionel Sambuc // A15-ARM:#define __ARM_FEATURE_DSP
224f4a2713aSLionel Sambuc 
225f4a2713aSLionel Sambuc // RUN: %clang -target armv7 -mthumb -mcpu=cortex-a15 -x c -E -dM %s -o - | FileCheck --check-prefix=A15-THUMB %s
226f4a2713aSLionel Sambuc // A15-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
227*0a6a1f1dSLionel Sambuc // A15-THUMB:#define __ARM_FEATURE_DSP
228*0a6a1f1dSLionel Sambuc 
229*0a6a1f1dSLionel Sambuc // Check that -mfpu works properly for Cortex-A17 (enabled by default).
230*0a6a1f1dSLionel Sambuc // RUN: %clang -target armv7-none-linux-gnueabi -mcpu=cortex-a17 -x c -E -dM %s -o - | FileCheck --check-prefix=DEFAULTFPU-A17 %s
231*0a6a1f1dSLionel Sambuc // RUN: %clang -target armv7-none-linux-gnueabi -mthumb -mcpu=cortex-a17 -x c -E -dM %s -o - | FileCheck --check-prefix=DEFAULTFPU-A17 %s
232*0a6a1f1dSLionel Sambuc // DEFAULTFPU-A17:#define __ARM_NEON__ 1
233*0a6a1f1dSLionel Sambuc // DEFAULTFPU-A17:#define __ARM_VFPV4__ 1
234*0a6a1f1dSLionel Sambuc 
235*0a6a1f1dSLionel Sambuc // RUN: %clang -target armv7-none-linux-gnueabi -mcpu=cortex-a17 -mfpu=none -x c -E -dM %s -o - | FileCheck --check-prefix=FPUNONE-A17 %s
236*0a6a1f1dSLionel Sambuc // RUN: %clang -target armv7-none-linux-gnueabi -mthumb -mcpu=cortex-a17 -mfpu=none -x c -E -dM %s -o - | FileCheck --check-prefix=FPUNONE-A17 %s
237*0a6a1f1dSLionel Sambuc // FPUNONE-A17-NOT:#define __ARM_NEON__ 1
238*0a6a1f1dSLionel Sambuc // FPUNONE-A17-NOT:#define __ARM_VFPV4__ 1
239*0a6a1f1dSLionel Sambuc 
240*0a6a1f1dSLionel Sambuc // Test whether predefines are as expected when targeting cortex-a17.
241*0a6a1f1dSLionel Sambuc // RUN: %clang -target armv7 -mcpu=cortex-a17 -x c -E -dM %s -o - | FileCheck --check-prefix=A17 %s
242*0a6a1f1dSLionel Sambuc // RUN: %clang -target armv7 -mthumb -mcpu=cortex-a17 -x c -E -dM %s -o - | FileCheck --check-prefix=A17 %s
243*0a6a1f1dSLionel Sambuc // A17:#define __ARM_ARCH 7
244*0a6a1f1dSLionel Sambuc // A17:#define __ARM_ARCH_7A__ 1
245*0a6a1f1dSLionel Sambuc // A17:#define __ARM_ARCH_EXT_IDIV__ 1
246*0a6a1f1dSLionel Sambuc // A17:#define __ARM_ARCH_PROFILE 'A'
247*0a6a1f1dSLionel Sambuc // A17:#define __ARM_FEATURE_DSP
248f4a2713aSLionel Sambuc 
249f4a2713aSLionel Sambuc // Test whether predefines are as expected when targeting swift.
250f4a2713aSLionel Sambuc // RUN: %clang -target armv7s -mcpu=swift -x c -E -dM %s -o - | FileCheck --check-prefix=SWIFT-ARM %s
251f4a2713aSLionel Sambuc // SWIFT-ARM:#define __ARM_ARCH_EXT_IDIV__ 1
252*0a6a1f1dSLionel Sambuc // SWIFT:#define __ARM_FEATURE_DSP
253f4a2713aSLionel Sambuc 
254f4a2713aSLionel Sambuc // RUN: %clang -target armv7s -mthumb -mcpu=swift -x c -E -dM %s -o - | FileCheck --check-prefix=SWIFT-THUMB %s
255f4a2713aSLionel Sambuc // SWIFT-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
256*0a6a1f1dSLionel Sambuc // SWIFT-THUMB:#define __ARM_FEATURE_DSP
257f4a2713aSLionel Sambuc 
258f4a2713aSLionel Sambuc // Test whether predefines are as expected when targeting cortex-a53.
259f4a2713aSLionel Sambuc // RUN: %clang -target armv8 -mcpu=cortex-a53 -x c -E -dM %s -o - | FileCheck --check-prefix=A53-ARM %s
260f4a2713aSLionel Sambuc // A53-ARM:#define __ARM_ARCH_EXT_IDIV__ 1
261*0a6a1f1dSLionel Sambuc // A53-ARM:#define __ARM_FEATURE_DSP
262f4a2713aSLionel Sambuc 
263f4a2713aSLionel Sambuc // RUN: %clang -target armv8 -mthumb -mcpu=cortex-a53 -x c -E -dM %s -o - | FileCheck --check-prefix=A53-THUMB %s
264f4a2713aSLionel Sambuc // A53-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
265*0a6a1f1dSLionel Sambuc // A53-THUMB:#define __ARM_FEATURE_DSP
266f4a2713aSLionel Sambuc 
267f4a2713aSLionel Sambuc // Test whether predefines are as expected when targeting cortex-r5.
268f4a2713aSLionel Sambuc // RUN: %clang -target armv7 -mcpu=cortex-r5 -x c -E -dM %s -o - | FileCheck --check-prefix=R5-ARM %s
269f4a2713aSLionel Sambuc // R5-ARM:#define __ARM_ARCH_EXT_IDIV__ 1
270*0a6a1f1dSLionel Sambuc // R5-ARM:#define __ARM_FEATURE_DSP
271f4a2713aSLionel Sambuc 
272f4a2713aSLionel Sambuc // RUN: %clang -target armv7 -mthumb -mcpu=cortex-r5 -x c -E -dM %s -o - | FileCheck --check-prefix=R5-THUMB %s
273f4a2713aSLionel Sambuc // R5-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
274*0a6a1f1dSLionel Sambuc // R5-THUMB:#define __ARM_FEATURE_DSP
275f4a2713aSLionel Sambuc 
276f4a2713aSLionel Sambuc // Test whether predefines are as expected when targeting cortex-m0.
277f4a2713aSLionel Sambuc // RUN: %clang -target armv7 -mthumb -mcpu=cortex-m0 -x c -E -dM %s -o - | FileCheck --check-prefix=M0-THUMB %s
278f4a2713aSLionel Sambuc // M0-THUMB-NOT:#define __ARM_ARCH_EXT_IDIV__
279*0a6a1f1dSLionel Sambuc // M0-THUMB-NOT:#define __ARM_FEATURE_DSP
280f4a2713aSLionel Sambuc 
281f4a2713aSLionel Sambuc // Test whether predefines are as expected when targeting cortex-m3.
282f4a2713aSLionel Sambuc // RUN: %clang -target armv7 -mthumb -mcpu=cortex-m3 -x c -E -dM %s -o - | FileCheck --check-prefix=M3-THUMB %s
283f4a2713aSLionel Sambuc // M3-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
284*0a6a1f1dSLionel Sambuc // M3-THUMB-NOT:#define __ARM_FEATURE_DSP
285f4a2713aSLionel Sambuc 
286f4a2713aSLionel Sambuc // Test whether predefines are as expected when targeting cortex-m4.
287f4a2713aSLionel Sambuc // RUN: %clang -target armv7 -mthumb -mcpu=cortex-m4 -x c -E -dM %s -o - | FileCheck --check-prefix=M4-THUMB %s
288f4a2713aSLionel Sambuc // M4-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
289*0a6a1f1dSLionel Sambuc // M4-THUMB:#define __ARM_FEATURE_DSP
290*0a6a1f1dSLionel Sambuc 
291*0a6a1f1dSLionel Sambuc // Test whether predefines are as expected when targeting cortex-m7.
292*0a6a1f1dSLionel Sambuc // RUN: %clang -target armv7 -mthumb -mcpu=cortex-m7 -x c -E -dM %s -o - | FileCheck --check-prefix=M7-THUMB %s
293*0a6a1f1dSLionel Sambuc // M7-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
294*0a6a1f1dSLionel Sambuc // M7-THUMB:#define __ARM_FEATURE_DSP
295*0a6a1f1dSLionel Sambuc 
296*0a6a1f1dSLionel Sambuc // Test whether predefines are as expected when targeting krait.
297*0a6a1f1dSLionel Sambuc // RUN: %clang -target armv7 -mcpu=krait -x c -E -dM %s -o - | FileCheck --check-prefix=KRAIT-ARM %s
298*0a6a1f1dSLionel Sambuc // KRAIT-ARM:#define __ARM_ARCH_EXT_IDIV__ 1
299*0a6a1f1dSLionel Sambuc // KRAIT-ARM:#define __ARM_FEATURE_DSP
300*0a6a1f1dSLionel Sambuc // KRAIT-ARM:#define  __ARM_VFPV4__ 1
301*0a6a1f1dSLionel Sambuc 
302*0a6a1f1dSLionel Sambuc // RUN: %clang -target armv7 -mthumb -mcpu=krait -x c -E -dM %s -o - | FileCheck --check-prefix=KRAIT-THUMB %s
303*0a6a1f1dSLionel Sambuc // KRAIT-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
304*0a6a1f1dSLionel Sambuc // KRAIT-THUMB:#define __ARM_FEATURE_DSP
305*0a6a1f1dSLionel Sambuc // KRAIT-THUMB:#define  __ARM_VFPV4__ 1
306