blob: a982d8085028c96353117dafa981a7469184f9ea [file] [log] [blame]
James Y Knight3508b222016-04-01 21:33:20 +00001// 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
Keith Walker167961f2018-02-19 12:40:26 +00008// CHECK-V8A-NOT: #define __ARM_FP 0x
Oliver Stannard39ee9de2018-04-27 13:56:02 +00009// CHECK-V8A-NOT: #define __ARM_FEATURE_DOTPROD
Keith Walker167961f2018-02-19 12:40:26 +000010
11// RUN: %clang -target armv8a-none-linux-gnueabi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V8A-ALLOW-FP-INSTR %s
12// RUN: %clang -target armv8a-none-linux-gnueabihf -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V8A-ALLOW-FP-INSTR %s
13// CHECK-V8A-ALLOW-FP-INSTR: #define __ARMEL__ 1
14// CHECK-V8A-ALLOW-FP-INSTR: #define __ARM_ARCH 8
15// CHECK-V8A-ALLOW-FP-INSTR: #define __ARM_ARCH_8A__ 1
16// CHECK-V8A-ALLOW-FP-INSTR: #define __ARM_FEATURE_CRC32 1
17// CHECK-V8A-ALLOW-FP-INSTR: #define __ARM_FEATURE_DIRECTED_ROUNDING 1
18// CHECK-V8A-ALLOW-FP-INSTR: #define __ARM_FEATURE_NUMERIC_MAXMIN 1
19// CHECK-V8A-ALLOW-FP-INSTR: #define __ARM_FP 0xe
20// CHECK-V8A-ALLOW-FP-INSTR: #define __ARM_FP16_ARGS 1
21// CHECK-V8A-ALLOW-FP-INSTR: #define __ARM_FP16_FORMAT_IEEE 1
Oliver Stannard39ee9de2018-04-27 13:56:02 +000022// CHECK-V8A-ALLOW-FP-INSTR-V8A-NOT: #define __ARM_FEATURE_DOTPROD
Joey Gouly1e8637b2013-09-18 10:07:09 +000023
Sjoerd Meijera7463df2018-03-13 22:11:06 +000024// RUN: %clang -target arm-none-linux-gnueabi -march=armv8.2a+fp16 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FULLFP16-VECTOR-SCALAR %s
25// CHECK-FULLFP16-VECTOR-SCALAR: #define __ARM_FEATURE_FP16_SCALAR_ARITHMETIC 1
26// CHECK-FULLFP16-VECTOR-SCALAR: #define __ARM_FEATURE_FP16_VECTOR_ARITHMETIC 1
27// CHECK-FULLFP16-VECTOR-SCALAR: #define __ARM_FP 0xe
28// CHECK-FULLFP16-VECTOR-SCALAR: #define __ARM_FP16_FORMAT_IEEE 1
29
30// RUN: %clang -target arm-none-linux-gnueabi -march=armv8.2a+fp16 -mfpu=vfp4 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FULLFP16-SCALAR %s
31// CHECK-FULLFP16-SCALAR: #define __ARM_FEATURE_FP16_SCALAR_ARITHMETIC 1
32// CHECK-FULLFP16-SCALAR-NOT: #define __ARM_FEATURE_FP16_VECTOR_ARITHMETIC 1
33// CHECK-FULLFP16-SCALAR: #define __ARM_FP 0xe
34// CHECK-FULLFP16-SCALAR: #define __ARM_FP16_FORMAT_IEEE 1
Oliver Stannard39ee9de2018-04-27 13:56:02 +000035//
36// RUN: %clang -target arm-none-linux-gnueabi -march=armv8.2a+dotprod -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-DOTPROD %s
37// CHECK-DOTPROD: #define __ARM_FEATURE_DOTPROD 1
Sjoerd Meijera7463df2018-03-13 22:11:06 +000038
Javed Absar00b74442016-10-07 12:08:41 +000039// RUN: %clang -target armv8r-none-linux-gnu -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V8R %s
40// CHECK-V8R: #define __ARMEL__ 1
41// CHECK-V8R: #define __ARM_ARCH 8
42// CHECK-V8R: #define __ARM_ARCH_8R__ 1
43// CHECK-V8R: #define __ARM_FEATURE_CRC32 1
44// CHECK-V8R: #define __ARM_FEATURE_DIRECTED_ROUNDING 1
45// CHECK-V8R: #define __ARM_FEATURE_NUMERIC_MAXMIN 1
Keith Walker167961f2018-02-19 12:40:26 +000046// CHECK-V8R-NOT: #define __ARM_FP 0x
47
48// RUN: %clang -target armv8r-none-linux-gnueabi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V8R-ALLOW-FP-INSTR %s
49// RUN: %clang -target armv8r-none-linux-gnueabihf -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V8R-ALLOW-FP-INSTR %s
50// CHECK-V8R-ALLOW-FP-INSTR: #define __ARMEL__ 1
51// CHECK-V8R-ALLOW-FP-INSTR: #define __ARM_ARCH 8
52// CHECK-V8R-ALLOW-FP-INSTR: #define __ARM_ARCH_8R__ 1
53// CHECK-V8R-ALLOW-FP-INSTR: #define __ARM_FEATURE_CRC32 1
54// CHECK-V8R-ALLOW-FP-INSTR: #define __ARM_FEATURE_DIRECTED_ROUNDING 1
55// CHECK-V8R-ALLOW-FP-INSTR: #define __ARM_FEATURE_NUMERIC_MAXMIN 1
56// CHECK-V8R-ALLOW-FP-INSTR: #define __ARM_FP 0xe
Javed Absar00b74442016-10-07 12:08:41 +000057
James Y Knight3508b222016-04-01 21:33:20 +000058// RUN: %clang -target armv7a-none-linux-gnu -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V7 %s
59// CHECK-V7: #define __ARMEL__ 1
60// CHECK-V7: #define __ARM_ARCH 7
61// CHECK-V7: #define __ARM_ARCH_7A__ 1
Nico Riecke6a158252014-02-16 07:29:41 +000062// CHECK-V7-NOT: __ARM_FEATURE_CRC32
Pablo Barrio1c1b2512016-03-15 19:03:09 +000063// CHECK-V7-NOT: __ARM_FEATURE_NUMERIC_MAXMIN
James Molloy0ffb0932014-09-15 11:25:38 +000064// CHECK-V7-NOT: __ARM_FEATURE_DIRECTED_ROUNDING
Keith Walker167961f2018-02-19 12:40:26 +000065// CHECK-V7-NOT: #define __ARM_FP 0x
66
67// RUN: %clang -target armv7a-none-linux-gnueabi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V7-ALLOW-FP-INSTR %s
68// RUN: %clang -target armv7a-none-linux-gnueabihf -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V7-ALLOW-FP-INSTR %s
69// CHECK-V7-ALLOW-FP-INSTR: #define __ARMEL__ 1
70// CHECK-V7-ALLOW-FP-INSTR: #define __ARM_ARCH 7
71// CHECK-V7-ALLOW-FP-INSTR: #define __ARM_ARCH_7A__ 1
72// CHECK-V7-ALLOW-FP-INSTR-NOT: __ARM_FEATURE_CRC32
73// CHECK-V7-ALLOW-FP-INSTR-NOT: __ARM_FEATURE_NUMERIC_MAXMIN
74// CHECK-V7-ALLOW-FP-INSTR-NOT: __ARM_FEATURE_DIRECTED_ROUNDING
75// CHECK-V7-ALLOW-FP-INSTR: #define __ARM_FP 0xc
Silviu Barangae5690462013-10-21 10:59:33 +000076
George Burgess IVfc970562017-02-09 23:30:10 +000077// RUN: %clang -target armv7ve-none-linux-gnu -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V7VE %s
78// CHECK-V7VE: #define __ARMEL__ 1
79// CHECK-V7VE: #define __ARM_ARCH 7
80// CHECK-V7VE: #define __ARM_ARCH_7VE__ 1
81// CHECK-V7VE: #define __ARM_ARCH_EXT_IDIV__ 1
Keith Walker167961f2018-02-19 12:40:26 +000082// CHECK-V7VE-NOT: #define __ARM_FP 0x
83
84// RUN: %clang -target armv7ve-none-linux-gnueabi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V7VE-DEFAULT-ABI-SOFT %s
85// RUN: %clang -target armv7ve-none-linux-gnueabihf -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V7VE-DEFAULT-ABI-SOFT %s
86// CHECK-V7VE-DEFAULT-ABI-SOFT: #define __ARMEL__ 1
87// CHECK-V7VE-DEFAULT-ABI-SOFT: #define __ARM_ARCH 7
88// CHECK-V7VE-DEFAULT-ABI-SOFT: #define __ARM_ARCH_7VE__ 1
89// CHECK-V7VE-DEFAULT-ABI-SOFT: #define __ARM_ARCH_EXT_IDIV__ 1
90// CHECK-V7VE-DEFAULT-ABI-SOFT: #define __ARM_FP 0xc
George Burgess IVfc970562017-02-09 23:30:10 +000091
James Y Knight3508b222016-04-01 21:33:20 +000092// RUN: %clang -target x86_64-apple-macosx10.10 -arch armv7s -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V7S %s
93// CHECK-V7S: #define __ARMEL__ 1
94// CHECK-V7S: #define __ARM_ARCH 7
95// CHECK-V7S: #define __ARM_ARCH_7S__ 1
Tim Northover525c73c2015-07-21 21:47:33 +000096// CHECK-V7S-NOT: __ARM_FEATURE_CRC32
97// CHECK-V7S-NOT: __ARM_FEATURE_NUMERIC_MAXMIN
98// CHECK-V7S-NOT: __ARM_FEATURE_DIRECTED_ROUNDING
Benjamin Kramer3a13ed62017-12-28 16:58:54 +000099// CHECK-V7S: #define __ARM_FP 0xe
Tim Northover525c73c2015-07-21 21:47:33 +0000100
James Y Knight3508b222016-04-01 21:33:20 +0000101// RUN: %clang -target armv8a -mfloat-abi=hard -x c -E -dM %s | FileCheck -match-full-lines --check-prefix=CHECK-V8-BAREHF %s
102// CHECK-V8-BAREHF: #define __ARMEL__ 1
103// CHECK-V8-BAREHF: #define __ARM_ARCH 8
104// CHECK-V8-BAREHF: #define __ARM_ARCH_8A__ 1
105// CHECK-V8-BAREHF: #define __ARM_FEATURE_CRC32 1
106// CHECK-V8-BAREHF: #define __ARM_FEATURE_DIRECTED_ROUNDING 1
107// CHECK-V8-BAREHF: #define __ARM_FEATURE_NUMERIC_MAXMIN 1
Benjamin Kramer3a13ed62017-12-28 16:58:54 +0000108// CHECK-V8-BAREHP: #define __ARM_FP 0xe
James Y Knight3508b222016-04-01 21:33:20 +0000109// CHECK-V8-BAREHF: #define __ARM_NEON__ 1
110// CHECK-V8-BAREHF: #define __ARM_PCS_VFP 1
111// CHECK-V8-BAREHF: #define __VFP_FP__ 1
Bernard Ogdenda13af32013-10-24 18:32:51 +0000112
James Y Knight3508b222016-04-01 21:33:20 +0000113// 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
Bernard Ogdenda13af32013-10-24 18:32:51 +0000114// CHECK-V8-BAREHF-FP-NOT: __ARM_NEON__ 1
Benjamin Kramer3a13ed62017-12-28 16:58:54 +0000115// CHECK-V8-BAREHP-FP: #define __ARM_FP 0xe
James Y Knight3508b222016-04-01 21:33:20 +0000116// CHECK-V8-BAREHF-FP: #define __VFP_FP__ 1
Bernard Ogdenda13af32013-10-24 18:32:51 +0000117
James Y Knight3508b222016-04-01 21:33:20 +0000118// RUN: %clang -target armv8a -mfloat-abi=hard -mfpu=neon-fp-armv8 -x c -E -dM %s | FileCheck -match-full-lines --check-prefix=CHECK-V8-BAREHF-NEON-FP %s
119// RUN: %clang -target armv8a -mfloat-abi=hard -mfpu=crypto-neon-fp-armv8 -x c -E -dM %s | FileCheck -match-full-lines --check-prefix=CHECK-V8-BAREHF-NEON-FP %s
Benjamin Kramer3a13ed62017-12-28 16:58:54 +0000120// CHECK-V8-BAREHP-NEON-FP: #define __ARM_FP 0xe
James Y Knight3508b222016-04-01 21:33:20 +0000121// CHECK-V8-BAREHF-NEON-FP: #define __ARM_NEON__ 1
122// CHECK-V8-BAREHF-NEON-FP: #define __VFP_FP__ 1
Bernard Ogdenda13af32013-10-24 18:32:51 +0000123
James Y Knight3508b222016-04-01 21:33:20 +0000124// RUN: %clang -target armv8a -mnocrc -x c -E -dM %s | FileCheck -match-full-lines --check-prefix=CHECK-V8-NOCRC %s
Bernard Ogden18b57012013-10-29 09:47:51 +0000125// CHECK-V8-NOCRC-NOT: __ARM_FEATURE_CRC32 1
126
Silviu Barangae5690462013-10-21 10:59:33 +0000127// Check that -mhwdiv works properly for armv8/thumbv8 (enabled by default).
128
James Y Knight3508b222016-04-01 21:33:20 +0000129// RUN: %clang -target armv8 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8 %s
130// RUN: %clang -target armv8 -mthumb -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8 %s
131// RUN: %clang -target armv8-eabi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8 %s
132// RUN: %clang -target armv8-eabi -mthumb -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8 %s
Artyom Skrobov59f43bb2016-03-23 13:32:33 +0000133// V8:#define __ARM_ARCH_EXT_IDIV__ 1
Silviu Barangae5690462013-10-21 10:59:33 +0000134
James Y Knight3508b222016-04-01 21:33:20 +0000135// RUN: %clang -target armv8 -mhwdiv=none -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NOHWDIV-V8 %s
136// RUN: %clang -target armv8 -mthumb -mhwdiv=none -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NOHWDIV-V8 %s
137// RUN: %clang -target armv8 -mhwdiv=thumb -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NOHWDIV-V8 %s
138// RUN: %clang -target armv8 -mthumb -mhwdiv=arm -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NOHWDIV-V8 %s
Artyom Skrobov59f43bb2016-03-23 13:32:33 +0000139// NOHWDIV-V8-NOT:#define __ARM_ARCH_EXT_IDIV__
Silviu Barangae5690462013-10-21 10:59:33 +0000140
James Y Knight3508b222016-04-01 21:33:20 +0000141// RUN: %clang -target armv8a -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8A %s
142// RUN: %clang -target armv8a -mthumb -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8A %s
Artyom Skrobov59f43bb2016-03-23 13:32:33 +0000143// V8A:#define __ARM_ARCH_EXT_IDIV__ 1
Keith Walker167961f2018-02-19 12:40:26 +0000144// V8A-NOT:#define __ARM_FP 0x
145
146// RUN: %clang -target armv8a-eabi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8A-ALLOW-FP-INSTR %s
147// RUN: %clang -target armv8a-eabi -mthumb -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8A-ALLOW-FP-INSTR %s
148// RUN: %clang -target armv8a-eabihf -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8A-ALLOW-FP-INSTR %s
149// RUN: %clang -target armv8a-eabihf -mthumb -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8A-ALLOW-FP-INSTR %s
150// V8A-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1
151// V8A-ALLOW-FP-INSTR:#define __ARM_FP 0xe
Silviu Barangae5690462013-10-21 10:59:33 +0000152
James Y Knight3508b222016-04-01 21:33:20 +0000153// RUN: %clang -target armv8m.base-none-linux-gnu -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8M_BASELINE %s
154// V8M_BASELINE: #define __ARM_ARCH 8
155// V8M_BASELINE: #define __ARM_ARCH_8M_BASE__ 1
156// V8M_BASELINE: #define __ARM_ARCH_EXT_IDIV__ 1
Bradley Smithf4affc12016-03-03 13:52:22 +0000157// V8M_BASELINE-NOT: __ARM_ARCH_ISA_ARM
James Y Knight3508b222016-04-01 21:33:20 +0000158// V8M_BASELINE: #define __ARM_ARCH_ISA_THUMB 1
159// V8M_BASELINE: #define __ARM_ARCH_PROFILE 'M'
Bradley Smithf4affc12016-03-03 13:52:22 +0000160// V8M_BASELINE-NOT: __ARM_FEATURE_CRC32
161// V8M_BASELINE-NOT: __ARM_FEATURE_DSP
162// V8M_BASELINE-NOT: __ARM_FP 0x{{.*}}
163// V8M_BASELINE-NOT: __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1
164
James Y Knight3508b222016-04-01 21:33:20 +0000165// RUN: %clang -target armv8m.main-none-linux-gnu -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8M_MAINLINE %s
166// V8M_MAINLINE: #define __ARM_ARCH 8
167// V8M_MAINLINE: #define __ARM_ARCH_8M_MAIN__ 1
168// V8M_MAINLINE: #define __ARM_ARCH_EXT_IDIV__ 1
Bradley Smithf4affc12016-03-03 13:52:22 +0000169// V8M_MAINLINE-NOT: __ARM_ARCH_ISA_ARM
James Y Knight3508b222016-04-01 21:33:20 +0000170// V8M_MAINLINE: #define __ARM_ARCH_ISA_THUMB 2
171// V8M_MAINLINE: #define __ARM_ARCH_PROFILE 'M'
Bradley Smithf4affc12016-03-03 13:52:22 +0000172// V8M_MAINLINE-NOT: __ARM_FEATURE_CRC32
173// V8M_MAINLINE-NOT: __ARM_FEATURE_DSP
Keith Walker167961f2018-02-19 12:40:26 +0000174// V8M_MAINLINE-NOT: #define __ARM_FP 0x
James Y Knight3508b222016-04-01 21:33:20 +0000175// V8M_MAINLINE: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
Bradley Smithf4affc12016-03-03 13:52:22 +0000176
Keith Walker167961f2018-02-19 12:40:26 +0000177// RUN: %clang -target armv8m.main-none-linux-gnueabi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8M-MAINLINE-ALLOW-FP-INSTR %s
178// RUN: %clang -target armv8m.main-none-linux-gnueabihf -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8M-MAINLINE-ALLOW-FP-INSTR %s
179// V8M-MAINLINE-ALLOW-FP-INSTR: #define __ARM_ARCH 8
180// V8M-MAINLINE-ALLOW-FP-INSTR: #define __ARM_ARCH_8M_MAIN__ 1
181// V8M-MAINLINE-ALLOW-FP-INSTR: #define __ARM_ARCH_EXT_IDIV__ 1
182// V8M-MAINLINE-ALLOW-FP-INSTR-NOT: __ARM_ARCH_ISA_ARM
183// V8M-MAINLINE-ALLOW-FP-INSTR: #define __ARM_ARCH_ISA_THUMB 2
184// V8M-MAINLINE-ALLOW-FP-INSTR: #define __ARM_ARCH_PROFILE 'M'
185// V8M-MAINLINE-ALLOW-FP-INSTR-NOT: __ARM_FEATURE_CRC32
186// V8M-MAINLINE-ALLOW-FP-INSTR-NOT: __ARM_FEATURE_DSP
187// V8M-MAINLINE-ALLOW-FP-INSTR: #define __ARM_FP 0xe
188// V8M-MAINLINE-ALLOW-FP-INSTR: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
189
James Y Knight3508b222016-04-01 21:33:20 +0000190// RUN: %clang -target arm-none-linux-gnu -march=armv8-m.main+dsp -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8M_MAINLINE_DSP %s
191// V8M_MAINLINE_DSP: #define __ARM_ARCH 8
192// V8M_MAINLINE_DSP: #define __ARM_ARCH_8M_MAIN__ 1
193// V8M_MAINLINE_DSP: #define __ARM_ARCH_EXT_IDIV__ 1
Bradley Smithf4affc12016-03-03 13:52:22 +0000194// V8M_MAINLINE_DSP-NOT: __ARM_ARCH_ISA_ARM
James Y Knight3508b222016-04-01 21:33:20 +0000195// V8M_MAINLINE_DSP: #define __ARM_ARCH_ISA_THUMB 2
196// V8M_MAINLINE_DSP: #define __ARM_ARCH_PROFILE 'M'
Bradley Smithf4affc12016-03-03 13:52:22 +0000197// V8M_MAINLINE_DSP-NOT: __ARM_FEATURE_CRC32
James Y Knight3508b222016-04-01 21:33:20 +0000198// V8M_MAINLINE_DSP: #define __ARM_FEATURE_DSP 1
Keith Walker167961f2018-02-19 12:40:26 +0000199// V8M_MAINLINE_DSP-NOT: #define __ARM_FP 0x
James Y Knight3508b222016-04-01 21:33:20 +0000200// V8M_MAINLINE_DSP: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
Bradley Smithf4affc12016-03-03 13:52:22 +0000201
Keith Walker167961f2018-02-19 12:40:26 +0000202// RUN: %clang -target arm-none-linux-gnueabi -march=armv8-m.main+dsp -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8M-MAINLINE-DSP-ALLOW-FP-INSTR %s
203// V8M-MAINLINE-DSP-ALLOW-FP-INSTR: #define __ARM_ARCH 8
204// V8M-MAINLINE-DSP-ALLOW-FP-INSTR: #define __ARM_ARCH_8M_MAIN__ 1
205// V8M-MAINLINE-DSP-ALLOW-FP-INSTR: #define __ARM_ARCH_EXT_IDIV__ 1
206// V8M-MAINLINE-DSP-ALLOW-FP-INSTR-NOT: __ARM_ARCH_ISA_ARM
207// V8M-MAINLINE-DSP-ALLOW-FP-INSTR: #define __ARM_ARCH_ISA_THUMB 2
208// V8M-MAINLINE-DSP-ALLOW-FP-INSTR: #define __ARM_ARCH_PROFILE 'M'
209// V8M-MAINLINE-DSP-ALLOW-FP-INSTR-NOT: __ARM_FEATURE_CRC32
210// V8M-MAINLINE-DSP-ALLOW-FP-INSTR: #define __ARM_FEATURE_DSP 1
211// V8M-MAINLINE-DSP-ALLOW-FP-INSTR: #define __ARM_FP 0xe
212// V8M-MAINLINE-DSP-ALLOW-FP-INSTR: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
213
James Y Knight3508b222016-04-01 21:33:20 +0000214// RUN: %clang -target arm-none-linux-gnu -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-DEFS %s
Alexandros Lamprineasf5a8e6c2015-10-02 14:56:37 +0000215// CHECK-DEFS:#define __ARM_PCS 1
Bradley Smith0f28f0c2014-01-20 10:52:00 +0000216// CHECK-DEFS:#define __ARM_SIZEOF_MINIMAL_ENUM 4
217// CHECK-DEFS:#define __ARM_SIZEOF_WCHAR_T 4
218
Alexandros Lamprineasf5a8e6c2015-10-02 14:56:37 +0000219// RUN: %clang -target arm-none-linux-gnu -fno-math-errno -fno-signed-zeros\
220// RUN: -fno-trapping-math -fassociative-math -freciprocal-math\
James Y Knight3508b222016-04-01 21:33:20 +0000221// RUN: -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FASTMATH %s
Alexandros Lamprineasf5a8e6c2015-10-02 14:56:37 +0000222// RUN: %clang -target arm-none-linux-gnu -ffast-math -x c -E -dM %s -o -\
James Y Knight3508b222016-04-01 21:33:20 +0000223// RUN: | FileCheck -match-full-lines --check-prefix=CHECK-FASTMATH %s
224// CHECK-FASTMATH: #define __ARM_FP_FAST 1
Alexandros Lamprineasf5a8e6c2015-10-02 14:56:37 +0000225
James Y Knight3508b222016-04-01 21:33:20 +0000226// RUN: %clang -target arm-none-linux-gnu -fshort-wchar -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-SHORTWCHAR %s
Bradley Smith0f28f0c2014-01-20 10:52:00 +0000227// CHECK-SHORTWCHAR:#define __ARM_SIZEOF_WCHAR_T 2
228
James Y Knight3508b222016-04-01 21:33:20 +0000229// RUN: %clang -target arm-none-linux-gnu -fshort-enums -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-SHORTENUMS %s
Bradley Smith0f28f0c2014-01-20 10:52:00 +0000230// CHECK-SHORTENUMS:#define __ARM_SIZEOF_MINIMAL_ENUM 1
Silviu Barangae5690462013-10-21 10:59:33 +0000231
232// Test that -mhwdiv has the right effect for a target CPU which has hwdiv enabled by default.
James Y Knight3508b222016-04-01 21:33:20 +0000233// RUN: %clang -target armv7 -mcpu=cortex-a15 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=HWDIV %s
234// RUN: %clang -target armv7 -mthumb -mcpu=cortex-a15 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=HWDIV %s
235// RUN: %clang -target armv7 -mcpu=cortex-a15 -mhwdiv=arm -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=HWDIV %s
236// RUN: %clang -target armv7 -mthumb -mcpu=cortex-a15 -mhwdiv=thumb -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=HWDIV %s
Artyom Skrobov59f43bb2016-03-23 13:32:33 +0000237// HWDIV:#define __ARM_ARCH_EXT_IDIV__ 1
Silviu Barangae5690462013-10-21 10:59:33 +0000238
James Y Knight3508b222016-04-01 21:33:20 +0000239// RUN: %clang -target arm -mcpu=cortex-a15 -mhwdiv=thumb -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NOHWDIV %s
240// RUN: %clang -target arm -mthumb -mcpu=cortex-a15 -mhwdiv=arm -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NOHWDIV %s
241// RUN: %clang -target arm -mcpu=cortex-a15 -mhwdiv=none -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NOHWDIV %s
242// RUN: %clang -target arm -mthumb -mcpu=cortex-a15 -mhwdiv=none -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NOHWDIV %s
Artyom Skrobov59f43bb2016-03-23 13:32:33 +0000243// NOHWDIV-NOT:#define __ARM_ARCH_EXT_IDIV__
Silviu Barangae5690462013-10-21 10:59:33 +0000244
Artyom Skrobov53b000a82013-11-21 14:04:38 +0000245
246// Check that -mfpu works properly for Cortex-A7 (enabled by default).
James Y Knight3508b222016-04-01 21:33:20 +0000247// RUN: %clang -target armv7-none-linux-gnueabi -mcpu=cortex-a7 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=DEFAULTFPU-A7 %s
248// RUN: %clang -target armv7-none-linux-gnueabi -mthumb -mcpu=cortex-a7 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=DEFAULTFPU-A7 %s
Keith Walker167961f2018-02-19 12:40:26 +0000249// RUN: %clang -target armv7-none-linux-gnueabihf -mcpu=cortex-a7 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=DEFAULTFPU-A7 %s
250// RUN: %clang -target armv7-none-linux-gnueabihf -mthumb -mcpu=cortex-a7 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=DEFAULTFPU-A7 %s
Benjamin Kramer3a13ed62017-12-28 16:58:54 +0000251// DEFAULTFPU-A7:#define __ARM_FP 0xe
Artyom Skrobov53b000a82013-11-21 14:04:38 +0000252// DEFAULTFPU-A7:#define __ARM_NEON__ 1
253// DEFAULTFPU-A7:#define __ARM_VFPV4__ 1
254
James Y Knight3508b222016-04-01 21:33:20 +0000255// RUN: %clang -target armv7-none-linux-gnueabi -mcpu=cortex-a7 -mfpu=none -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=FPUNONE-A7 %s
256// RUN: %clang -target armv7-none-linux-gnueabi -mthumb -mcpu=cortex-a7 -mfpu=none -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=FPUNONE-A7 %s
Richard Barton7dacc242015-10-21 10:03:55 +0000257// FPUNONE-A7-NOT:#define __ARM_FP 0x{{.*}}
Artyom Skrobov53b000a82013-11-21 14:04:38 +0000258// FPUNONE-A7-NOT:#define __ARM_NEON__ 1
259// FPUNONE-A7-NOT:#define __ARM_VFPV4__ 1
260
James Y Knight3508b222016-04-01 21:33:20 +0000261// RUN: %clang -target armv7-none-linux-gnueabi -mcpu=cortex-a7 -mfpu=vfp4 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NONEON-A7 %s
262// RUN: %clang -target armv7-none-linux-gnueabi -mthumb -mcpu=cortex-a7 -mfpu=vfp4 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NONEON-A7 %s
Benjamin Kramer3a13ed62017-12-28 16:58:54 +0000263// NONEON-A7:#define __ARM_FP 0xe
Artyom Skrobov53b000a82013-11-21 14:04:38 +0000264// NONEON-A7-NOT:#define __ARM_NEON__ 1
265// NONEON-A7:#define __ARM_VFPV4__ 1
266
Amara Emersona1daec72013-11-25 13:18:59 +0000267// Check that -mfpu works properly for Cortex-A5 (enabled by default).
James Y Knight3508b222016-04-01 21:33:20 +0000268// RUN: %clang -target armv7-none-linux-gnueabi -mcpu=cortex-a5 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=DEFAULTFPU-A5 %s
269// RUN: %clang -target armv7-none-linux-gnueabi -mthumb -mcpu=cortex-a5 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=DEFAULTFPU-A5 %s
Benjamin Kramer3a13ed62017-12-28 16:58:54 +0000270// DEFAULTFPU-A5:#define __ARM_FP 0xe
Amara Emersona1daec72013-11-25 13:18:59 +0000271// DEFAULTFPU-A5:#define __ARM_NEON__ 1
272// DEFAULTFPU-A5:#define __ARM_VFPV4__ 1
273
James Y Knight3508b222016-04-01 21:33:20 +0000274// RUN: %clang -target armv7-none-linux-gnueabi -mcpu=cortex-a5 -mfpu=none -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=FPUNONE-A5 %s
275// RUN: %clang -target armv7-none-linux-gnueabi -mthumb -mcpu=cortex-a5 -mfpu=none -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=FPUNONE-A5 %s
Richard Barton7dacc242015-10-21 10:03:55 +0000276// FPUNONE-A5-NOT:#define __ARM_FP 0x{{.*}}
Amara Emersona1daec72013-11-25 13:18:59 +0000277// FPUNONE-A5-NOT:#define __ARM_NEON__ 1
278// FPUNONE-A5-NOT:#define __ARM_VFPV4__ 1
279
James Y Knight3508b222016-04-01 21:33:20 +0000280// RUN: %clang -target armv7-none-linux-gnueabi -mcpu=cortex-a5 -mfpu=vfp4-d16 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NONEON-A5 %s
281// RUN: %clang -target armv7-none-linux-gnueabi -mthumb -mcpu=cortex-a5 -mfpu=vfp4-d16 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NONEON-A5 %s
Benjamin Kramer3a13ed62017-12-28 16:58:54 +0000282// NONEON-A5:#define __ARM_FP 0xe
Amara Emersona1daec72013-11-25 13:18:59 +0000283// NONEON-A5-NOT:#define __ARM_NEON__ 1
284// NONEON-A5:#define __ARM_VFPV4__ 1
285
Silviu Barangae5690462013-10-21 10:59:33 +0000286// FIXME: add check for further predefines
Sergey Dmitrouk745f5302014-11-25 08:57:36 +0000287// Test whether predefines are as expected when targeting ep9312.
James Y Knight3508b222016-04-01 21:33:20 +0000288// RUN: %clang -target armv4t -mcpu=ep9312 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A4T %s
Sergey Dmitrouk745f5302014-11-25 08:57:36 +0000289// A4T-NOT:#define __ARM_FEATURE_DSP
Richard Barton7dacc242015-10-21 10:03:55 +0000290// A4T-NOT:#define __ARM_FP 0x{{.*}}
Sergey Dmitrouk745f5302014-11-25 08:57:36 +0000291
292// Test whether predefines are as expected when targeting arm10tdmi.
James Y Knight3508b222016-04-01 21:33:20 +0000293// RUN: %clang -target armv5 -mcpu=arm10tdmi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A5T %s
Sergey Dmitrouk745f5302014-11-25 08:57:36 +0000294// A5T-NOT:#define __ARM_FEATURE_DSP
Richard Barton7dacc242015-10-21 10:03:55 +0000295// A5T-NOT:#define __ARM_FP 0x{{.*}}
Sergey Dmitrouk745f5302014-11-25 08:57:36 +0000296
Keith Walker167961f2018-02-19 12:40:26 +0000297// Test whether predefines are as expected when targeting cortex-a5i (soft FP ABI as default).
James Y Knight3508b222016-04-01 21:33:20 +0000298// RUN: %clang -target armv7 -mcpu=cortex-a5 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A5 %s
299// RUN: %clang -target armv7 -mthumb -mcpu=cortex-a5 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A5 %s
Amara Emersona1daec72013-11-25 13:18:59 +0000300// A5:#define __ARM_ARCH 7
301// A5:#define __ARM_ARCH_7A__ 1
Artyom Skrobov59f43bb2016-03-23 13:32:33 +0000302// A5-NOT:#define __ARM_ARCH_EXT_IDIV__
Saleem Abdulrasool52a5d412014-06-15 18:48:41 +0000303// A5:#define __ARM_ARCH_PROFILE 'A'
Martell Malonec950c652017-11-29 07:25:12 +0000304// A5-NOT:#define __ARM_DWARF_EH__ 1
James Molloy0ffb0932014-09-15 11:25:38 +0000305// A5-NOT: #define __ARM_FEATURE_DIRECTED_ROUNDING
James Y Knight3508b222016-04-01 21:33:20 +0000306// A5:#define __ARM_FEATURE_DSP 1
Artyom Skrobov59f43bb2016-03-23 13:32:33 +0000307// A5-NOT: #define __ARM_FEATURE_NUMERIC_MAXMIN
Keith Walker167961f2018-02-19 12:40:26 +0000308// A5-NOT:#define __ARM_FP 0x
Amara Emersona1daec72013-11-25 13:18:59 +0000309
Keith Walker167961f2018-02-19 12:40:26 +0000310// Test whether predefines are as expected when targeting cortex-a5 (softfp FP ABI as default).
311// RUN: %clang -target armv7-eabi -mcpu=cortex-a5 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A5-ALLOW-FP-INSTR %s
312// RUN: %clang -target armv7-eabi -mthumb -mcpu=cortex-a5 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A5-ALLOW-FP-INSTR %s
313// A5-ALLOW-FP-INSTR:#define __ARM_ARCH 7
314// A5-ALLOW-FP-INSTR:#define __ARM_ARCH_7A__ 1
315// A5-ALLOW-FP-INSTR-NOT:#define __ARM_ARCH_EXT_IDIV__
316// A5-ALLOW-FP-INSTR:#define __ARM_ARCH_PROFILE 'A'
317// A5-ALLOW-FP-INSTR-NOT: #define __ARM_FEATURE_DIRECTED_ROUNDING
318// A5-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
319// A5-ALLOW-FP-INSTR-NOT: #define __ARM_FEATURE_NUMERIC_MAXMIN
320// A5-ALLOW-FP-INSTR:#define __ARM_FP 0xe
321
322// Test whether predefines are as expected when targeting cortex-a7 (soft FP ABI as default).
James Y Knight3508b222016-04-01 21:33:20 +0000323// RUN: %clang -target armv7k -mcpu=cortex-a7 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A7 %s
324// RUN: %clang -target armv7k -mthumb -mcpu=cortex-a7 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A7 %s
Artyom Skrobov53b000a82013-11-21 14:04:38 +0000325// A7:#define __ARM_ARCH 7
Artyom Skrobov53b000a82013-11-21 14:04:38 +0000326// A7:#define __ARM_ARCH_EXT_IDIV__ 1
Saleem Abdulrasool52a5d412014-06-15 18:48:41 +0000327// A7:#define __ARM_ARCH_PROFILE 'A'
Martell Malonec950c652017-11-29 07:25:12 +0000328// A7-NOT:#define __ARM_DWARF_EH__ 1
James Y Knight3508b222016-04-01 21:33:20 +0000329// A7:#define __ARM_FEATURE_DSP 1
Keith Walker167961f2018-02-19 12:40:26 +0000330// A7-NOT:#define __ARM_FP 0x
331
332// Test whether predefines are as expected when targeting cortex-a7 (softfp FP ABI as default).
333// RUN: %clang -target armv7k-eabi -mcpu=cortex-a7 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A7-ALLOW-FP-INSTR %s
334// RUN: %clang -target armv7k-eabi -mthumb -mcpu=cortex-a7 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A7-ALLOW-FP-INSTR %s
335// A7-ALLOW-FP-INSTR:#define __ARM_ARCH 7
336// A7-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1
337// A7-ALLOW-FP-INSTR:#define __ARM_ARCH_PROFILE 'A'
338// A7-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
339// A7-ALLOW-FP-INSTR:#define __ARM_FP 0xe
Artyom Skrobov53b000a82013-11-21 14:04:38 +0000340
Tim Northover32617992016-04-28 14:01:49 +0000341// Test whether predefines are as expected when targeting cortex-a7.
342// RUN: %clang -target x86_64-apple-darwin -arch armv7k -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV7K %s
343// ARMV7K:#define __ARM_ARCH 7
344// ARMV7K:#define __ARM_ARCH_EXT_IDIV__ 1
345// ARMV7K:#define __ARM_ARCH_PROFILE 'A'
Chris Bieneman46977b62016-04-29 17:53:00 +0000346// ARMV7K:#define __ARM_DWARF_EH__ 1
Tim Northover32617992016-04-28 14:01:49 +0000347// ARMV7K:#define __ARM_FEATURE_DSP 1
Benjamin Kramer3a13ed62017-12-28 16:58:54 +0000348// ARMV7K:#define __ARM_FP 0xe
Tim Northover32617992016-04-28 14:01:49 +0000349// ARMV7K:#define __ARM_PCS_VFP 1
350
351
Keith Walker167961f2018-02-19 12:40:26 +0000352// Test whether predefines are as expected when targeting cortex-a8 (soft FP ABI as default).
James Y Knight3508b222016-04-01 21:33:20 +0000353// RUN: %clang -target armv7 -mcpu=cortex-a8 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A8 %s
354// RUN: %clang -target armv7 -mthumb -mcpu=cortex-a8 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A8 %s
Artyom Skrobov59f43bb2016-03-23 13:32:33 +0000355// A8-NOT:#define __ARM_ARCH_EXT_IDIV__
James Y Knight3508b222016-04-01 21:33:20 +0000356// A8:#define __ARM_FEATURE_DSP 1
Keith Walker167961f2018-02-19 12:40:26 +0000357// A8-NOT:#define __ARM_FP 0x
Silviu Barangae5690462013-10-21 10:59:33 +0000358
Keith Walker167961f2018-02-19 12:40:26 +0000359// Test whether predefines are as expected when targeting cortex-a8 (softfp FP ABI as default).
360// RUN: %clang -target armv7-eabi -mcpu=cortex-a8 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A8-ALLOW-FP-INSTR %s
361// RUN: %clang -target armv7-eabi -mthumb -mcpu=cortex-a8 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A8-ALLOW-FP-INSTR %s
362// A8-ALLOW-FP-INSTR-NOT:#define __ARM_ARCH_EXT_IDIV__
363// A8-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
364// A8-ALLOW-FP-INSTR:#define __ARM_FP 0xc
365
366// Test whether predefines are as expected when targeting cortex-a9 (soft FP as default).
James Y Knight3508b222016-04-01 21:33:20 +0000367// RUN: %clang -target armv7 -mcpu=cortex-a9 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A9 %s
368// RUN: %clang -target armv7 -mthumb -mcpu=cortex-a9 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A9 %s
Artyom Skrobov59f43bb2016-03-23 13:32:33 +0000369// A9-NOT:#define __ARM_ARCH_EXT_IDIV__
James Y Knight3508b222016-04-01 21:33:20 +0000370// A9:#define __ARM_FEATURE_DSP 1
Keith Walker167961f2018-02-19 12:40:26 +0000371// A9-NOT:#define __ARM_FP 0x
372
373// Test whether predefines are as expected when targeting cortex-a9 (softfp FP as default).
374// RUN: %clang -target armv7-eabi -mcpu=cortex-a9 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A9-ALLOW-FP-INSTR %s
375// RUN: %clang -target armv7-eabi -mthumb -mcpu=cortex-a9 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A9-ALLOW-FP-INSTR %s
376// A9-ALLOW-FP-INSTR-NOT:#define __ARM_ARCH_EXT_IDIV__
377// A9-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
378// A9-ALLOW-FP-INSTR:#define __ARM_FP 0xe
Silviu Barangae5690462013-10-21 10:59:33 +0000379
Richard Barton3b82ed32013-11-22 11:53:28 +0000380
381// Check that -mfpu works properly for Cortex-A12 (enabled by default).
James Y Knight3508b222016-04-01 21:33:20 +0000382// RUN: %clang -target armv7-none-linux-gnueabi -mcpu=cortex-a12 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=DEFAULTFPU-A12 %s
383// RUN: %clang -target armv7-none-linux-gnueabi -mthumb -mcpu=cortex-a12 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=DEFAULTFPU-A12 %s
Benjamin Kramer3a13ed62017-12-28 16:58:54 +0000384// DEFAULTFPU-A12:#define __ARM_FP 0xe
Richard Barton3b82ed32013-11-22 11:53:28 +0000385// DEFAULTFPU-A12:#define __ARM_NEON__ 1
386// DEFAULTFPU-A12:#define __ARM_VFPV4__ 1
387
James Y Knight3508b222016-04-01 21:33:20 +0000388// RUN: %clang -target armv7-none-linux-gnueabi -mcpu=cortex-a12 -mfpu=none -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=FPUNONE-A12 %s
389// RUN: %clang -target armv7-none-linux-gnueabi -mthumb -mcpu=cortex-a12 -mfpu=none -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=FPUNONE-A12 %s
Richard Barton7dacc242015-10-21 10:03:55 +0000390// FPUNONE-A12-NOT:#define __ARM_FP 0x{{.*}}
Richard Barton3b82ed32013-11-22 11:53:28 +0000391// FPUNONE-A12-NOT:#define __ARM_NEON__ 1
392// FPUNONE-A12-NOT:#define __ARM_VFPV4__ 1
393
Keith Walker167961f2018-02-19 12:40:26 +0000394// Test whether predefines are as expected when targeting cortex-a12 (soft FP ABI as default).
James Y Knight3508b222016-04-01 21:33:20 +0000395// RUN: %clang -target armv7 -mcpu=cortex-a12 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A12 %s
396// RUN: %clang -target armv7 -mthumb -mcpu=cortex-a12 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A12 %s
Richard Barton3b82ed32013-11-22 11:53:28 +0000397// A12:#define __ARM_ARCH 7
398// A12:#define __ARM_ARCH_7A__ 1
399// A12:#define __ARM_ARCH_EXT_IDIV__ 1
Saleem Abdulrasool52a5d412014-06-15 18:48:41 +0000400// A12:#define __ARM_ARCH_PROFILE 'A'
James Y Knight3508b222016-04-01 21:33:20 +0000401// A12:#define __ARM_FEATURE_DSP 1
Keith Walker167961f2018-02-19 12:40:26 +0000402// A12-NOT:#define __ARM_FP 0x
Richard Barton3b82ed32013-11-22 11:53:28 +0000403
Keith Walker167961f2018-02-19 12:40:26 +0000404// Test whether predefines are as expected when targeting cortex-a12 (soft FP ABI as default).
405// RUN: %clang -target armv7-eabi -mcpu=cortex-a12 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A12-ALLOW-FP-INSTR %s
406// RUN: %clang -target armv7-eabi -mthumb -mcpu=cortex-a12 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A12-ALLOW-FP-INSTR %s
407// A12-ALLOW-FP-INSTR:#define __ARM_ARCH 7
408// A12-ALLOW-FP-INSTR:#define __ARM_ARCH_7A__ 1
409// A12-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1
410// A12-ALLOW-FP-INSTR:#define __ARM_ARCH_PROFILE 'A'
411// A12-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
412// A12-ALLOW-FP-INSTR:#define __ARM_FP 0xe
413
414// Test whether predefines are as expected when targeting cortex-a15 (soft FP ABI as default).
James Y Knight3508b222016-04-01 21:33:20 +0000415// RUN: %clang -target armv7 -mcpu=cortex-a15 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A15 %s
416// RUN: %clang -target armv7 -mthumb -mcpu=cortex-a15 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A15 %s
Artyom Skrobov59f43bb2016-03-23 13:32:33 +0000417// A15:#define __ARM_ARCH_EXT_IDIV__ 1
James Y Knight3508b222016-04-01 21:33:20 +0000418// A15:#define __ARM_FEATURE_DSP 1
Keith Walker167961f2018-02-19 12:40:26 +0000419// A15-NOT:#define __ARM_FP 0x
420
421// Test whether predefines are as expected when targeting cortex-a15 (softfp ABI as default).
422// RUN: %clang -target armv7-eabi -mcpu=cortex-a15 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A15-ALLOW-FP-INSTR %s
423// RUN: %clang -target armv7-eabi -mthumb -mcpu=cortex-a15 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A15-ALLOW-FP-INSTR %s
424// A15-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1
425// A15-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
426// A15-ALLOW-FP-INSTR:#define __ARM_FP 0xe
Silviu Barangae5690462013-10-21 10:59:33 +0000427
Renato Golin5886bc32014-10-13 10:22:48 +0000428// Check that -mfpu works properly for Cortex-A17 (enabled by default).
James Y Knight3508b222016-04-01 21:33:20 +0000429// RUN: %clang -target armv7-none-linux-gnueabi -mcpu=cortex-a17 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=DEFAULTFPU-A17 %s
430// RUN: %clang -target armv7-none-linux-gnueabi -mthumb -mcpu=cortex-a17 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=DEFAULTFPU-A17 %s
Benjamin Kramer3a13ed62017-12-28 16:58:54 +0000431// DEFAULTFPU-A17:#define __ARM_FP 0xe
Renato Golin5886bc32014-10-13 10:22:48 +0000432// DEFAULTFPU-A17:#define __ARM_NEON__ 1
433// DEFAULTFPU-A17:#define __ARM_VFPV4__ 1
434
James Y Knight3508b222016-04-01 21:33:20 +0000435// RUN: %clang -target armv7-none-linux-gnueabi -mcpu=cortex-a17 -mfpu=none -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=FPUNONE-A17 %s
436// RUN: %clang -target armv7-none-linux-gnueabi -mthumb -mcpu=cortex-a17 -mfpu=none -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=FPUNONE-A17 %s
Richard Barton7dacc242015-10-21 10:03:55 +0000437// FPUNONE-A17-NOT:#define __ARM_FP 0x{{.*}}
Renato Golin5886bc32014-10-13 10:22:48 +0000438// FPUNONE-A17-NOT:#define __ARM_NEON__ 1
439// FPUNONE-A17-NOT:#define __ARM_VFPV4__ 1
440
Keith Walker167961f2018-02-19 12:40:26 +0000441// Test whether predefines are as expected when targeting cortex-a17 (soft FP ABI as default).
James Y Knight3508b222016-04-01 21:33:20 +0000442// RUN: %clang -target armv7 -mcpu=cortex-a17 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A17 %s
443// RUN: %clang -target armv7 -mthumb -mcpu=cortex-a17 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A17 %s
Renato Golin5886bc32014-10-13 10:22:48 +0000444// A17:#define __ARM_ARCH 7
445// A17:#define __ARM_ARCH_7A__ 1
446// A17:#define __ARM_ARCH_EXT_IDIV__ 1
447// A17:#define __ARM_ARCH_PROFILE 'A'
James Y Knight3508b222016-04-01 21:33:20 +0000448// A17:#define __ARM_FEATURE_DSP 1
Keith Walker167961f2018-02-19 12:40:26 +0000449// A17-NOT:#define __ARM_FP 0x
Renato Golin5886bc32014-10-13 10:22:48 +0000450
Keith Walker167961f2018-02-19 12:40:26 +0000451// Test whether predefines are as expected when targeting cortex-a17 (softfp FP ABI as default).
452// RUN: %clang -target armv7-eabi -mcpu=cortex-a17 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A17-ALLOW-FP-INSTR %s
453// RUN: %clang -target armv7-eabi -mthumb -mcpu=cortex-a17 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A17-ALLOW-FP-INSTR %s
454// A17-ALLOW-FP-INSTR:#define __ARM_ARCH 7
455// A17-ALLOW-FP-INSTR:#define __ARM_ARCH_7A__ 1
456// A17-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1
457// A17-ALLOW-FP-INSTR:#define __ARM_ARCH_PROFILE 'A'
458// A17-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
459// A17-ALLOW-FP-INSTR:#define __ARM_FP 0xe
460
461// Test whether predefines are as expected when targeting swift (soft FP ABI as default).
James Y Knight3508b222016-04-01 21:33:20 +0000462// RUN: %clang -target armv7s -mcpu=swift -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=SWIFT %s
463// RUN: %clang -target armv7s -mthumb -mcpu=swift -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=SWIFT %s
Artyom Skrobov59f43bb2016-03-23 13:32:33 +0000464// SWIFT:#define __ARM_ARCH_EXT_IDIV__ 1
James Y Knight3508b222016-04-01 21:33:20 +0000465// SWIFT:#define __ARM_FEATURE_DSP 1
Keith Walker167961f2018-02-19 12:40:26 +0000466// SWIFT-NOT:#define __ARM_FP 0xxE
Silviu Barangae5690462013-10-21 10:59:33 +0000467
Keith Walker167961f2018-02-19 12:40:26 +0000468// Test whether predefines are as expected when targeting swift (softfp FP ABI as default).
469// RUN: %clang -target armv7s-eabi -mcpu=swift -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=SWIFT-ALLOW-FP-INSTR %s
470// RUN: %clang -target armv7s-eabi -mthumb -mcpu=swift -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=SWIFT-ALLOW-FP-INSTR %s
471// SWIFT-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1
472// SWIFT-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
473// SWIFT-ALLOW-FP-INSTR:#define __ARM_FP 0xe
474
475// Test whether predefines are as expected when targeting ARMv8-A Cortex implementations (soft FP ABI as default)
James Y Knight3508b222016-04-01 21:33:20 +0000476// RUN: %clang -target armv8 -mcpu=cortex-a32 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
477// RUN: %clang -target armv8 -mthumb -mcpu=cortex-a32 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
Sjoerd Meijerb3b81472016-06-03 08:47:56 +0000478// RUN: %clang -target armv8 -mcpu=cortex-a35 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
479// RUN: %clang -target armv8 -mthumb -mcpu=cortex-a35 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
James Y Knight3508b222016-04-01 21:33:20 +0000480// RUN: %clang -target armv8 -mcpu=cortex-a53 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
481// RUN: %clang -target armv8 -mthumb -mcpu=cortex-a53 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
Sjoerd Meijerb3b81472016-06-03 08:47:56 +0000482// RUN: %clang -target armv8 -mcpu=cortex-a57 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
483// RUN: %clang -target armv8 -mthumb -mcpu=cortex-a57 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
484// RUN: %clang -target armv8 -mcpu=cortex-a72 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
485// RUN: %clang -target armv8 -mthumb -mcpu=cortex-a72 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
Sjoerd Meijer90df4a72016-06-02 10:48:37 +0000486// RUN: %clang -target armv8 -mcpu=cortex-a73 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
487// RUN: %clang -target armv8 -mthumb -mcpu=cortex-a73 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
Evandro Menezes08045232018-06-06 18:58:01 +0000488//
489// RUN: %clang -target armv8 -mcpu=exynos-m1 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
490// RUN: %clang -target armv8 -mthumb -mcpu=exynos-m1 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
491// RUN: %clang -target armv8 -mcpu=exynos-m2 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
492// RUN: %clang -target armv8 -mthumb -mcpu=exynos-m2 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
493// RUN: %clang -target armv8 -mcpu=exynos-m3 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
494// RUN: %clang -target armv8 -mthumb -mcpu=exynos-m3 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
495// RUN: %clang -target armv8 -mcpu=exynos-m4 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
496// RUN: %clang -target armv8 -mthumb -mcpu=exynos-m4 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
Artyom Skrobov59f43bb2016-03-23 13:32:33 +0000497// ARMV8:#define __ARM_ARCH_EXT_IDIV__ 1
James Y Knight3508b222016-04-01 21:33:20 +0000498// ARMV8:#define __ARM_FEATURE_DSP 1
Keith Walker167961f2018-02-19 12:40:26 +0000499// ARMV8-NOT:#define __ARM_FP 0x
500
501// Test whether predefines are as expected when targeting ARMv8-A Cortex implementations (softfp FP ABI as default)
502// RUN: %clang -target armv8-eabi -mcpu=cortex-a32 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8-ALLOW-FP-INSTR %s
503// RUN: %clang -target armv8-eabi -mthumb -mcpu=cortex-a32 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8-ALLOW-FP-INSTR %s
504// RUN: %clang -target armv8-eabi -mcpu=cortex-a35 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8-ALLOW-FP-INSTR %s
505// RUN: %clang -target armv8-eabi -mthumb -mcpu=cortex-a35 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8-ALLOW-FP-INSTR %s
506// RUN: %clang -target armv8-eabi -mcpu=cortex-a53 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8-ALLOW-FP-INSTR %s
507// RUN: %clang -target armv8-eabi -mthumb -mcpu=cortex-a53 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8-ALLOW-FP-INSTR %s
508// RUN: %clang -target armv8-eabi -mcpu=cortex-a57 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8-ALLOW-FP-INSTR %s
509// RUN: %clang -target armv8-eabi -mthumb -mcpu=cortex-a57 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8-ALLOW-FP-INSTR %s
510// RUN: %clang -target armv8-eabi -mcpu=cortex-a72 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8-ALLOW-FP-INSTR %s
511// RUN: %clang -target armv8-eabi -mthumb -mcpu=cortex-a72 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8-ALLOW-FP-INSTR %s
512// RUN: %clang -target armv8-eabi -mcpu=cortex-a73 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8-ALLOW-FP-INSTR %s
513// RUN: %clang -target armv8-eabi -mthumb -mcpu=cortex-a73 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8-ALLOW-FP-INSTR %s
Evandro Menezes08045232018-06-06 18:58:01 +0000514//
515// RUN: %clang -target armv8-eabi -mcpu=exynos-m1 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8-ALLOW-FP-INSTR %s
516// RUN: %clang -target armv8-eabi -mthumb -mcpu=exynos-m1 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8-ALLOW-FP-INSTR %s
517// RUN: %clang -target armv8-eabi -mcpu=exynos-m2 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8-ALLOW-FP-INSTR %s
518// RUN: %clang -target armv8-eabi -mthumb -mcpu=exynos-m2 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8-ALLOW-FP-INSTR %s
519// RUN: %clang -target armv8-eabi -mcpu=exynos-m3 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8-ALLOW-FP-INSTR %s
520// RUN: %clang -target armv8-eabi -mthumb -mcpu=exynos-m3 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8-ALLOW-FP-INSTR %s
521// RUN: %clang -target armv8-eabi -mcpu=exynos-m4 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8-ALLOW-FP-INSTR %s
522// RUN: %clang -target armv8-eabi -mthumb -mcpu=exynos-m4 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8-ALLOW-FP-INSTR %s
Keith Walker167961f2018-02-19 12:40:26 +0000523// ARMV8-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1
524// ARMV8-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
525// ARMV8-ALLOW-FP-INSTR:#define __ARM_FP 0xe
Silviu Barangae5690462013-10-21 10:59:33 +0000526
Javed Absar879d18b82015-04-09 14:12:10 +0000527// Test whether predefines are as expected when targeting cortex-r4.
James Y Knight3508b222016-04-01 21:33:20 +0000528// RUN: %clang -target armv7 -mcpu=cortex-r4 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R4-ARM %s
Javed Absar879d18b82015-04-09 14:12:10 +0000529// R4-ARM-NOT:#define __ARM_ARCH_EXT_IDIV__
James Y Knight3508b222016-04-01 21:33:20 +0000530// R4-ARM:#define __ARM_FEATURE_DSP 1
Richard Barton7dacc242015-10-21 10:03:55 +0000531// R4-ARM-NOT:#define __ARM_FP 0x{{.*}}
Javed Absar879d18b82015-04-09 14:12:10 +0000532
James Y Knight3508b222016-04-01 21:33:20 +0000533// RUN: %clang -target armv7 -mthumb -mcpu=cortex-r4 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R4-THUMB %s
Javed Absar879d18b82015-04-09 14:12:10 +0000534// R4-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
James Y Knight3508b222016-04-01 21:33:20 +0000535// R4-THUMB:#define __ARM_FEATURE_DSP 1
Richard Barton7dacc242015-10-21 10:03:55 +0000536// R4-THUMB-NOT:#define __ARM_FP 0x{{.*}}
Javed Absar879d18b82015-04-09 14:12:10 +0000537
Keith Walker167961f2018-02-19 12:40:26 +0000538// Test whether predefines are as expected when targeting cortex-r4f (soft FP ABI as default).
James Y Knight3508b222016-04-01 21:33:20 +0000539// RUN: %clang -target armv7 -mcpu=cortex-r4f -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R4F-ARM %s
Javed Absar879d18b82015-04-09 14:12:10 +0000540// R4F-ARM-NOT:#define __ARM_ARCH_EXT_IDIV__
James Y Knight3508b222016-04-01 21:33:20 +0000541// R4F-ARM:#define __ARM_FEATURE_DSP 1
Keith Walker167961f2018-02-19 12:40:26 +0000542// R4F-ARM-NOT:#define __ARM_FP 0x
543
544// Test whether predefines are as expected when targeting cortex-r4f (softfp FP ABI as default).
545// RUN: %clang -target armv7-eabi -mcpu=cortex-r4f -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R4F-ARM-ALLOW-FP-INSTR %s
546// R4F-ARM-ALLOW-FP-INSTR-NOT:#define __ARM_ARCH_EXT_IDIV__
547// R4F-ARM-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
548// R4F-ARM-ALLOW-FP-INSTR:#define __ARM_FP 0xc
Javed Absar879d18b82015-04-09 14:12:10 +0000549
James Y Knight3508b222016-04-01 21:33:20 +0000550// RUN: %clang -target armv7 -mthumb -mcpu=cortex-r4f -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R4F-THUMB %s
Artyom Skrobov59f43bb2016-03-23 13:32:33 +0000551// R4F-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
James Y Knight3508b222016-04-01 21:33:20 +0000552// R4F-THUMB:#define __ARM_FEATURE_DSP 1
Keith Walker167961f2018-02-19 12:40:26 +0000553// R4F-THUMB-NOT:#define __ARM_FP 0x
Javed Absar879d18b82015-04-09 14:12:10 +0000554
Keith Walker167961f2018-02-19 12:40:26 +0000555// RUN: %clang -target armv7-eabi -mthumb -mcpu=cortex-r4f -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R4F-THUMB-ALLOW-FP-INSTR %s
556// R4F-THUMB-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1
557// R4F-THUMB-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
558// R4F-THUMB-ALLOW-FP-INSTR:#define __ARM_FP 0xc
559
560// Test whether predefines are as expected when targeting cortex-r5 (soft FP ABI as default).
James Y Knight3508b222016-04-01 21:33:20 +0000561// RUN: %clang -target armv7 -mcpu=cortex-r5 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R5 %s
562// RUN: %clang -target armv7 -mthumb -mcpu=cortex-r5 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R5 %s
Artyom Skrobov59f43bb2016-03-23 13:32:33 +0000563// R5:#define __ARM_ARCH_EXT_IDIV__ 1
James Y Knight3508b222016-04-01 21:33:20 +0000564// R5:#define __ARM_FEATURE_DSP 1
Keith Walker167961f2018-02-19 12:40:26 +0000565// R5-NOT:#define __ARM_FP 0x
Silviu Barangae5690462013-10-21 10:59:33 +0000566
Keith Walker167961f2018-02-19 12:40:26 +0000567// Test whether predefines are as expected when targeting cortex-r5 (softfp FP ABI as default).
568// RUN: %clang -target armv7-eabi -mcpu=cortex-r5 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R5-ALLOW-FP-INSTR %s
569// RUN: %clang -target armv7-eabi -mthumb -mcpu=cortex-r5 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R5-ALLOW-FP-INSTR %s
570// R5-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1
571// R5-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
572// R5-ALLOW-FP-INSTR:#define __ARM_FP 0xc
573
574// Test whether predefines are as expected when targeting cortex-r7 and cortex-r8 (soft FP ABI as default).
James Y Knight3508b222016-04-01 21:33:20 +0000575// RUN: %clang -target armv7 -mcpu=cortex-r7 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R7-R8 %s
576// RUN: %clang -target armv7 -mthumb -mcpu=cortex-r7 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R7-R8 %s
577// RUN: %clang -target armv7 -mcpu=cortex-r8 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R7-R8 %s
578// RUN: %clang -target armv7 -mthumb -mcpu=cortex-r8 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R7-R8 %s
Artyom Skrobov59f43bb2016-03-23 13:32:33 +0000579// R7-R8:#define __ARM_ARCH_EXT_IDIV__ 1
James Y Knight3508b222016-04-01 21:33:20 +0000580// R7-R8:#define __ARM_FEATURE_DSP 1
Keith Walker167961f2018-02-19 12:40:26 +0000581// R7-R8-NOT:#define __ARM_FP 0x
582
583// Test whether predefines are as expected when targeting cortex-r7 and cortex-r8 (softfp FP ABI as default).
584// RUN: %clang -target armv7-eabi -mcpu=cortex-r7 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R7-R8-ALLOW-FP-INSTR %s
585// RUN: %clang -target armv7-eabi -mthumb -mcpu=cortex-r7 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R7-R8-ALLOW-FP-INSTR %s
586// RUN: %clang -target armv7-eabi -mcpu=cortex-r8 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R7-R8-ALLOW-FP-INSTR %s
587// RUN: %clang -target armv7-eabi -mthumb -mcpu=cortex-r8 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R7-R8-ALLOW-FP-INSTR %s
588// R7-R8-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1
589// R7-R8-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
590// R7-R8-ALLOW-FP-INSTR:#define __ARM_FP 0xe
Bradley Smithd86d6702015-02-18 10:34:48 +0000591
Silviu Barangae5690462013-10-21 10:59:33 +0000592// Test whether predefines are as expected when targeting cortex-m0.
James Y Knight3508b222016-04-01 21:33:20 +0000593// RUN: %clang -target armv7 -mthumb -mcpu=cortex-m0 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M0-THUMB %s
594// RUN: %clang -target armv7 -mthumb -mcpu=cortex-m0plus -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M0-THUMB %s
595// RUN: %clang -target armv7 -mthumb -mcpu=cortex-m1 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M0-THUMB %s
596// RUN: %clang -target armv7 -mthumb -mcpu=sc000 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M0-THUMB %s
Silviu Barangae5690462013-10-21 10:59:33 +0000597// M0-THUMB-NOT:#define __ARM_ARCH_EXT_IDIV__
Sergey Dmitrouk745f5302014-11-25 08:57:36 +0000598// M0-THUMB-NOT:#define __ARM_FEATURE_DSP
Richard Barton7dacc242015-10-21 10:03:55 +0000599// M0-THUMB-NOT:#define __ARM_FP 0x{{.*}}
Silviu Barangae5690462013-10-21 10:59:33 +0000600
601// Test whether predefines are as expected when targeting cortex-m3.
James Y Knight3508b222016-04-01 21:33:20 +0000602// RUN: %clang -target armv7 -mthumb -mcpu=cortex-m3 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M3-THUMB %s
603// RUN: %clang -target armv7 -mthumb -mcpu=sc300 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M3-THUMB %s
Silviu Barangae5690462013-10-21 10:59:33 +0000604// M3-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
Sergey Dmitrouk745f5302014-11-25 08:57:36 +0000605// M3-THUMB-NOT:#define __ARM_FEATURE_DSP
Richard Barton7dacc242015-10-21 10:03:55 +0000606// M3-THUMB-NOT:#define __ARM_FP 0x{{.*}}
Silviu Barangae5690462013-10-21 10:59:33 +0000607
Keith Walker167961f2018-02-19 12:40:26 +0000608// Test whether predefines are as expected when targeting cortex-m4 (soft FP ABI as default).
James Y Knight3508b222016-04-01 21:33:20 +0000609// RUN: %clang -target armv7 -mthumb -mcpu=cortex-m4 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M4-THUMB %s
Silviu Barangae5690462013-10-21 10:59:33 +0000610// M4-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
James Y Knight3508b222016-04-01 21:33:20 +0000611// M4-THUMB:#define __ARM_FEATURE_DSP 1
Keith Walker167961f2018-02-19 12:40:26 +0000612// M4-THUMB-NOT:#define __ARM_FP 0x
Ana Pazosdd6068d2013-12-06 22:43:17 +0000613
Keith Walker167961f2018-02-19 12:40:26 +0000614// Test whether predefines are as expected when targeting cortex-m4 (softfp ABI as default).
615// RUN: %clang -target armv7-eabi -mthumb -mcpu=cortex-m4 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M4-THUMB-ALLOW-FP-INSTR %s
616// M4-THUMB-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1
617// M4-THUMB-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
618// M4-THUMB-ALLOW-FP-INSTR:#define __ARM_FP 0x6
619
620// Test whether predefines are as expected when targeting cortex-m7 (soft FP ABI as default).
James Y Knight3508b222016-04-01 21:33:20 +0000621// RUN: %clang -target armv7 -mthumb -mcpu=cortex-m7 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M7-THUMB %s
Oliver Stannardbfd3ea32014-10-01 09:03:02 +0000622// M7-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
James Y Knight3508b222016-04-01 21:33:20 +0000623// M7-THUMB:#define __ARM_FEATURE_DSP 1
Keith Walker167961f2018-02-19 12:40:26 +0000624// M7-THUMB-NOT:#define __ARM_FP 0x
625// M7-THUMB-NOT:#define __ARM_FPV5__
626
627// Test whether predefines are as expected when targeting cortex-m7 (softfp FP ABI as default).
628// RUN: %clang -target armv7-eabi -mthumb -mcpu=cortex-m7 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M7-THUMB-ALLOW-FP-INSTR %s
629// M7-THUMB-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1
630// M7-THUMB-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
631// M7-THUMB-ALLOW-FP-INSTR:#define __ARM_FP 0xe
632// M7-THUMB-ALLOW-FP-INSTR:#define __ARM_FPV5__ 1
Oliver Stannardbfd3ea32014-10-01 09:03:02 +0000633
Sanne Wouda0479e692017-02-20 10:37:01 +0000634// Test whether predefines are as expected when targeting v8m cores
635// RUN: %clang -target arm -mcpu=cortex-m23 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M23 %s
636// M23: #define __ARM_ARCH 8
637// M23: #define __ARM_ARCH_8M_BASE__ 1
638// M23: #define __ARM_ARCH_EXT_IDIV__ 1
639// M23-NOT: __ARM_ARCH_ISA_ARM
640// M23: #define __ARM_ARCH_ISA_THUMB 1
641// M23: #define __ARM_ARCH_PROFILE 'M'
642// M23-NOT: __ARM_FEATURE_CRC32
643// M23-NOT: __ARM_FEATURE_DSP
644// M23-NOT: __ARM_FP 0x{{.*}}
645// M23-NOT: __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1
646
Keith Walker167961f2018-02-19 12:40:26 +0000647// Test whether predefines are as expected when targeting m33 (soft FP ABI as default).
Sanne Wouda0479e692017-02-20 10:37:01 +0000648// RUN: %clang -target arm -mcpu=cortex-m33 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M33 %s
649// M33: #define __ARM_ARCH 8
650// M33: #define __ARM_ARCH_8M_MAIN__ 1
651// M33: #define __ARM_ARCH_EXT_IDIV__ 1
652// M33-NOT: __ARM_ARCH_ISA_ARM
653// M33: #define __ARM_ARCH_ISA_THUMB 2
654// M33: #define __ARM_ARCH_PROFILE 'M'
655// M33-NOT: __ARM_FEATURE_CRC32
656// M33: #define __ARM_FEATURE_DSP 1
Keith Walker167961f2018-02-19 12:40:26 +0000657// M33-NOT: #define __ARM_FP 0x
Sanne Wouda0479e692017-02-20 10:37:01 +0000658// M33: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
659
Keith Walker167961f2018-02-19 12:40:26 +0000660// Test whether predefines are as expected when targeting m33 (softfp FP ABI as default).
661// RUN: %clang -target arm-eabi -mcpu=cortex-m33 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M33-ALLOW-FP-INSTR %s
662// M33-ALLOW-FP-INSTR: #define __ARM_ARCH 8
663// M33-ALLOW-FP-INSTR: #define __ARM_ARCH_8M_MAIN__ 1
664// M33-ALLOW-FP-INSTR: #define __ARM_ARCH_EXT_IDIV__ 1
665// M33-ALLOW-FP-INSTR-NOT: __ARM_ARCH_ISA_ARM
666// M33-ALLOW-FP-INSTR: #define __ARM_ARCH_ISA_THUMB 2
667// M33-ALLOW-FP-INSTR: #define __ARM_ARCH_PROFILE 'M'
668// M33-ALLOW-FP-INSTR-NOT: __ARM_FEATURE_CRC32
669// M33-ALLOW-FP-INSTR: #define __ARM_FEATURE_DSP 1
670// M33-ALLOW-FP-INSTR: #define __ARM_FP 0x6
671// M33-ALLOW-FP-INSTR: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
672
673// Test whether predefines are as expected when targeting krait (soft FP as default).
James Y Knight3508b222016-04-01 21:33:20 +0000674// RUN: %clang -target armv7 -mcpu=krait -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=KRAIT %s
675// RUN: %clang -target armv7 -mthumb -mcpu=krait -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=KRAIT %s
Artyom Skrobov59f43bb2016-03-23 13:32:33 +0000676// KRAIT:#define __ARM_ARCH_EXT_IDIV__ 1
James Y Knight3508b222016-04-01 21:33:20 +0000677// KRAIT:#define __ARM_FEATURE_DSP 1
Keith Walker167961f2018-02-19 12:40:26 +0000678// KRAIT-NOT:#define __ARM_VFPV4__
679
680// Test whether predefines are as expected when targeting krait (softfp FP as default).
681// RUN: %clang -target armv7-eabi -mcpu=krait -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=KRAIT-ALLOW-FP-INSTR %s
682// RUN: %clang -target armv7-eabi -mthumb -mcpu=krait -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=KRAIT-ALLOW-FP-INSTR %s
683// KRAIT-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1
684// KRAIT-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
685// KRAIT-ALLOW-FP-INSTR:#define __ARM_VFPV4__ 1
Vladimir Sukharevc6dab752015-05-14 08:25:18 +0000686
James Y Knight3508b222016-04-01 21:33:20 +0000687// RUN: %clang -target armv8.1a-none-none-eabi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V81A %s
688// CHECK-V81A: #define __ARM_ARCH 8
689// CHECK-V81A: #define __ARM_ARCH_8_1A__ 1
Vladimir Sukharevc6dab752015-05-14 08:25:18 +0000690// CHECK-V81A: #define __ARM_ARCH_PROFILE 'A'
James Y Knight3508b222016-04-01 21:33:20 +0000691// CHECK-V81A: #define __ARM_FEATURE_QRDMX 1
Benjamin Kramer3a13ed62017-12-28 16:58:54 +0000692// CHECK-V81A: #define __ARM_FP 0xe
Oliver Stannard3086c042016-02-11 16:05:52 +0000693
James Y Knight3508b222016-04-01 21:33:20 +0000694// RUN: %clang -target armv8.2a-none-none-eabi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V82A %s
695// CHECK-V82A: #define __ARM_ARCH 8
696// CHECK-V82A: #define __ARM_ARCH_8_2A__ 1
Oliver Stannard3086c042016-02-11 16:05:52 +0000697// CHECK-V82A: #define __ARM_ARCH_PROFILE 'A'
Sjoerd Meijercb75f612017-06-30 08:07:34 +0000698// CHECK-V82A: #define __ARM_FEATURE_QRDMX 1
Benjamin Kramer3a13ed62017-12-28 16:58:54 +0000699// CHECK-V82A: #define __ARM_FP 0xe