blob: 82ab96424cfd3c7c0007134b5d5cc7c474979024 [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
9
10// 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
11// 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
12// CHECK-V8A-ALLOW-FP-INSTR: #define __ARMEL__ 1
13// CHECK-V8A-ALLOW-FP-INSTR: #define __ARM_ARCH 8
14// CHECK-V8A-ALLOW-FP-INSTR: #define __ARM_ARCH_8A__ 1
15// CHECK-V8A-ALLOW-FP-INSTR: #define __ARM_FEATURE_CRC32 1
16// CHECK-V8A-ALLOW-FP-INSTR: #define __ARM_FEATURE_DIRECTED_ROUNDING 1
17// CHECK-V8A-ALLOW-FP-INSTR: #define __ARM_FEATURE_NUMERIC_MAXMIN 1
18// CHECK-V8A-ALLOW-FP-INSTR: #define __ARM_FP 0xe
19// CHECK-V8A-ALLOW-FP-INSTR: #define __ARM_FP16_ARGS 1
20// CHECK-V8A-ALLOW-FP-INSTR: #define __ARM_FP16_FORMAT_IEEE 1
Joey Gouly1e8637b2013-09-18 10:07:09 +000021
Javed Absar00b74442016-10-07 12:08:41 +000022// RUN: %clang -target armv8r-none-linux-gnu -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V8R %s
23// CHECK-V8R: #define __ARMEL__ 1
24// CHECK-V8R: #define __ARM_ARCH 8
25// CHECK-V8R: #define __ARM_ARCH_8R__ 1
26// CHECK-V8R: #define __ARM_FEATURE_CRC32 1
27// CHECK-V8R: #define __ARM_FEATURE_DIRECTED_ROUNDING 1
28// CHECK-V8R: #define __ARM_FEATURE_NUMERIC_MAXMIN 1
Keith Walker167961f2018-02-19 12:40:26 +000029// CHECK-V8R-NOT: #define __ARM_FP 0x
30
31// 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
32// 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
33// CHECK-V8R-ALLOW-FP-INSTR: #define __ARMEL__ 1
34// CHECK-V8R-ALLOW-FP-INSTR: #define __ARM_ARCH 8
35// CHECK-V8R-ALLOW-FP-INSTR: #define __ARM_ARCH_8R__ 1
36// CHECK-V8R-ALLOW-FP-INSTR: #define __ARM_FEATURE_CRC32 1
37// CHECK-V8R-ALLOW-FP-INSTR: #define __ARM_FEATURE_DIRECTED_ROUNDING 1
38// CHECK-V8R-ALLOW-FP-INSTR: #define __ARM_FEATURE_NUMERIC_MAXMIN 1
39// CHECK-V8R-ALLOW-FP-INSTR: #define __ARM_FP 0xe
Javed Absar00b74442016-10-07 12:08:41 +000040
James Y Knight3508b222016-04-01 21:33:20 +000041// RUN: %clang -target armv7a-none-linux-gnu -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V7 %s
42// CHECK-V7: #define __ARMEL__ 1
43// CHECK-V7: #define __ARM_ARCH 7
44// CHECK-V7: #define __ARM_ARCH_7A__ 1
Nico Riecke6a158252014-02-16 07:29:41 +000045// CHECK-V7-NOT: __ARM_FEATURE_CRC32
Pablo Barrio1c1b2512016-03-15 19:03:09 +000046// CHECK-V7-NOT: __ARM_FEATURE_NUMERIC_MAXMIN
James Molloy0ffb0932014-09-15 11:25:38 +000047// CHECK-V7-NOT: __ARM_FEATURE_DIRECTED_ROUNDING
Keith Walker167961f2018-02-19 12:40:26 +000048// CHECK-V7-NOT: #define __ARM_FP 0x
49
50// 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
51// 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
52// CHECK-V7-ALLOW-FP-INSTR: #define __ARMEL__ 1
53// CHECK-V7-ALLOW-FP-INSTR: #define __ARM_ARCH 7
54// CHECK-V7-ALLOW-FP-INSTR: #define __ARM_ARCH_7A__ 1
55// CHECK-V7-ALLOW-FP-INSTR-NOT: __ARM_FEATURE_CRC32
56// CHECK-V7-ALLOW-FP-INSTR-NOT: __ARM_FEATURE_NUMERIC_MAXMIN
57// CHECK-V7-ALLOW-FP-INSTR-NOT: __ARM_FEATURE_DIRECTED_ROUNDING
58// CHECK-V7-ALLOW-FP-INSTR: #define __ARM_FP 0xc
Silviu Barangae5690462013-10-21 10:59:33 +000059
George Burgess IVfc970562017-02-09 23:30:10 +000060// RUN: %clang -target armv7ve-none-linux-gnu -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V7VE %s
61// CHECK-V7VE: #define __ARMEL__ 1
62// CHECK-V7VE: #define __ARM_ARCH 7
63// CHECK-V7VE: #define __ARM_ARCH_7VE__ 1
64// CHECK-V7VE: #define __ARM_ARCH_EXT_IDIV__ 1
Keith Walker167961f2018-02-19 12:40:26 +000065// CHECK-V7VE-NOT: #define __ARM_FP 0x
66
67// 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
68// 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
69// CHECK-V7VE-DEFAULT-ABI-SOFT: #define __ARMEL__ 1
70// CHECK-V7VE-DEFAULT-ABI-SOFT: #define __ARM_ARCH 7
71// CHECK-V7VE-DEFAULT-ABI-SOFT: #define __ARM_ARCH_7VE__ 1
72// CHECK-V7VE-DEFAULT-ABI-SOFT: #define __ARM_ARCH_EXT_IDIV__ 1
73// CHECK-V7VE-DEFAULT-ABI-SOFT: #define __ARM_FP 0xc
George Burgess IVfc970562017-02-09 23:30:10 +000074
James Y Knight3508b222016-04-01 21:33:20 +000075// 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
76// CHECK-V7S: #define __ARMEL__ 1
77// CHECK-V7S: #define __ARM_ARCH 7
78// CHECK-V7S: #define __ARM_ARCH_7S__ 1
Tim Northover525c73c2015-07-21 21:47:33 +000079// CHECK-V7S-NOT: __ARM_FEATURE_CRC32
80// CHECK-V7S-NOT: __ARM_FEATURE_NUMERIC_MAXMIN
81// CHECK-V7S-NOT: __ARM_FEATURE_DIRECTED_ROUNDING
Benjamin Kramer3a13ed62017-12-28 16:58:54 +000082// CHECK-V7S: #define __ARM_FP 0xe
Tim Northover525c73c2015-07-21 21:47:33 +000083
James Y Knight3508b222016-04-01 21:33:20 +000084// RUN: %clang -target armv8a -mfloat-abi=hard -x c -E -dM %s | FileCheck -match-full-lines --check-prefix=CHECK-V8-BAREHF %s
85// CHECK-V8-BAREHF: #define __ARMEL__ 1
86// CHECK-V8-BAREHF: #define __ARM_ARCH 8
87// CHECK-V8-BAREHF: #define __ARM_ARCH_8A__ 1
88// CHECK-V8-BAREHF: #define __ARM_FEATURE_CRC32 1
89// CHECK-V8-BAREHF: #define __ARM_FEATURE_DIRECTED_ROUNDING 1
90// CHECK-V8-BAREHF: #define __ARM_FEATURE_NUMERIC_MAXMIN 1
Benjamin Kramer3a13ed62017-12-28 16:58:54 +000091// CHECK-V8-BAREHP: #define __ARM_FP 0xe
James Y Knight3508b222016-04-01 21:33:20 +000092// CHECK-V8-BAREHF: #define __ARM_NEON__ 1
93// CHECK-V8-BAREHF: #define __ARM_PCS_VFP 1
94// CHECK-V8-BAREHF: #define __VFP_FP__ 1
Bernard Ogdenda13af32013-10-24 18:32:51 +000095
James Y Knight3508b222016-04-01 21:33:20 +000096// 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 +000097// CHECK-V8-BAREHF-FP-NOT: __ARM_NEON__ 1
Benjamin Kramer3a13ed62017-12-28 16:58:54 +000098// CHECK-V8-BAREHP-FP: #define __ARM_FP 0xe
James Y Knight3508b222016-04-01 21:33:20 +000099// CHECK-V8-BAREHF-FP: #define __VFP_FP__ 1
Bernard Ogdenda13af32013-10-24 18:32:51 +0000100
James Y Knight3508b222016-04-01 21:33:20 +0000101// 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
102// 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 +0000103// CHECK-V8-BAREHP-NEON-FP: #define __ARM_FP 0xe
James Y Knight3508b222016-04-01 21:33:20 +0000104// CHECK-V8-BAREHF-NEON-FP: #define __ARM_NEON__ 1
105// CHECK-V8-BAREHF-NEON-FP: #define __VFP_FP__ 1
Bernard Ogdenda13af32013-10-24 18:32:51 +0000106
James Y Knight3508b222016-04-01 21:33:20 +0000107// 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 +0000108// CHECK-V8-NOCRC-NOT: __ARM_FEATURE_CRC32 1
109
Silviu Barangae5690462013-10-21 10:59:33 +0000110// Check that -mhwdiv works properly for armv8/thumbv8 (enabled by default).
111
James Y Knight3508b222016-04-01 21:33:20 +0000112// RUN: %clang -target armv8 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8 %s
113// RUN: %clang -target armv8 -mthumb -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8 %s
114// RUN: %clang -target armv8-eabi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8 %s
115// 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 +0000116// V8:#define __ARM_ARCH_EXT_IDIV__ 1
Silviu Barangae5690462013-10-21 10:59:33 +0000117
James Y Knight3508b222016-04-01 21:33:20 +0000118// RUN: %clang -target armv8 -mhwdiv=none -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NOHWDIV-V8 %s
119// RUN: %clang -target armv8 -mthumb -mhwdiv=none -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NOHWDIV-V8 %s
120// RUN: %clang -target armv8 -mhwdiv=thumb -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NOHWDIV-V8 %s
121// 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 +0000122// NOHWDIV-V8-NOT:#define __ARM_ARCH_EXT_IDIV__
Silviu Barangae5690462013-10-21 10:59:33 +0000123
James Y Knight3508b222016-04-01 21:33:20 +0000124// RUN: %clang -target armv8a -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8A %s
125// 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 +0000126// V8A:#define __ARM_ARCH_EXT_IDIV__ 1
Keith Walker167961f2018-02-19 12:40:26 +0000127// V8A-NOT:#define __ARM_FP 0x
128
129// RUN: %clang -target armv8a-eabi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8A-ALLOW-FP-INSTR %s
130// RUN: %clang -target armv8a-eabi -mthumb -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8A-ALLOW-FP-INSTR %s
131// RUN: %clang -target armv8a-eabihf -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8A-ALLOW-FP-INSTR %s
132// RUN: %clang -target armv8a-eabihf -mthumb -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8A-ALLOW-FP-INSTR %s
133// V8A-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1
134// V8A-ALLOW-FP-INSTR:#define __ARM_FP 0xe
Silviu Barangae5690462013-10-21 10:59:33 +0000135
James Y Knight3508b222016-04-01 21:33:20 +0000136// RUN: %clang -target armv8m.base-none-linux-gnu -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8M_BASELINE %s
137// V8M_BASELINE: #define __ARM_ARCH 8
138// V8M_BASELINE: #define __ARM_ARCH_8M_BASE__ 1
139// V8M_BASELINE: #define __ARM_ARCH_EXT_IDIV__ 1
Bradley Smithf4affc12016-03-03 13:52:22 +0000140// V8M_BASELINE-NOT: __ARM_ARCH_ISA_ARM
James Y Knight3508b222016-04-01 21:33:20 +0000141// V8M_BASELINE: #define __ARM_ARCH_ISA_THUMB 1
142// V8M_BASELINE: #define __ARM_ARCH_PROFILE 'M'
Bradley Smithf4affc12016-03-03 13:52:22 +0000143// V8M_BASELINE-NOT: __ARM_FEATURE_CRC32
144// V8M_BASELINE-NOT: __ARM_FEATURE_DSP
145// V8M_BASELINE-NOT: __ARM_FP 0x{{.*}}
146// V8M_BASELINE-NOT: __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1
147
James Y Knight3508b222016-04-01 21:33:20 +0000148// RUN: %clang -target armv8m.main-none-linux-gnu -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8M_MAINLINE %s
149// V8M_MAINLINE: #define __ARM_ARCH 8
150// V8M_MAINLINE: #define __ARM_ARCH_8M_MAIN__ 1
151// V8M_MAINLINE: #define __ARM_ARCH_EXT_IDIV__ 1
Bradley Smithf4affc12016-03-03 13:52:22 +0000152// V8M_MAINLINE-NOT: __ARM_ARCH_ISA_ARM
James Y Knight3508b222016-04-01 21:33:20 +0000153// V8M_MAINLINE: #define __ARM_ARCH_ISA_THUMB 2
154// V8M_MAINLINE: #define __ARM_ARCH_PROFILE 'M'
Bradley Smithf4affc12016-03-03 13:52:22 +0000155// V8M_MAINLINE-NOT: __ARM_FEATURE_CRC32
156// V8M_MAINLINE-NOT: __ARM_FEATURE_DSP
Keith Walker167961f2018-02-19 12:40:26 +0000157// V8M_MAINLINE-NOT: #define __ARM_FP 0x
James Y Knight3508b222016-04-01 21:33:20 +0000158// V8M_MAINLINE: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
Bradley Smithf4affc12016-03-03 13:52:22 +0000159
Keith Walker167961f2018-02-19 12:40:26 +0000160// 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
161// 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
162// V8M-MAINLINE-ALLOW-FP-INSTR: #define __ARM_ARCH 8
163// V8M-MAINLINE-ALLOW-FP-INSTR: #define __ARM_ARCH_8M_MAIN__ 1
164// V8M-MAINLINE-ALLOW-FP-INSTR: #define __ARM_ARCH_EXT_IDIV__ 1
165// V8M-MAINLINE-ALLOW-FP-INSTR-NOT: __ARM_ARCH_ISA_ARM
166// V8M-MAINLINE-ALLOW-FP-INSTR: #define __ARM_ARCH_ISA_THUMB 2
167// V8M-MAINLINE-ALLOW-FP-INSTR: #define __ARM_ARCH_PROFILE 'M'
168// V8M-MAINLINE-ALLOW-FP-INSTR-NOT: __ARM_FEATURE_CRC32
169// V8M-MAINLINE-ALLOW-FP-INSTR-NOT: __ARM_FEATURE_DSP
170// V8M-MAINLINE-ALLOW-FP-INSTR: #define __ARM_FP 0xe
171// V8M-MAINLINE-ALLOW-FP-INSTR: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
172
James Y Knight3508b222016-04-01 21:33:20 +0000173// 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
174// V8M_MAINLINE_DSP: #define __ARM_ARCH 8
175// V8M_MAINLINE_DSP: #define __ARM_ARCH_8M_MAIN__ 1
176// V8M_MAINLINE_DSP: #define __ARM_ARCH_EXT_IDIV__ 1
Bradley Smithf4affc12016-03-03 13:52:22 +0000177// V8M_MAINLINE_DSP-NOT: __ARM_ARCH_ISA_ARM
James Y Knight3508b222016-04-01 21:33:20 +0000178// V8M_MAINLINE_DSP: #define __ARM_ARCH_ISA_THUMB 2
179// V8M_MAINLINE_DSP: #define __ARM_ARCH_PROFILE 'M'
Bradley Smithf4affc12016-03-03 13:52:22 +0000180// V8M_MAINLINE_DSP-NOT: __ARM_FEATURE_CRC32
James Y Knight3508b222016-04-01 21:33:20 +0000181// V8M_MAINLINE_DSP: #define __ARM_FEATURE_DSP 1
Keith Walker167961f2018-02-19 12:40:26 +0000182// V8M_MAINLINE_DSP-NOT: #define __ARM_FP 0x
James Y Knight3508b222016-04-01 21:33:20 +0000183// V8M_MAINLINE_DSP: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
Bradley Smithf4affc12016-03-03 13:52:22 +0000184
Keith Walker167961f2018-02-19 12:40:26 +0000185// 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
186// V8M-MAINLINE-DSP-ALLOW-FP-INSTR: #define __ARM_ARCH 8
187// V8M-MAINLINE-DSP-ALLOW-FP-INSTR: #define __ARM_ARCH_8M_MAIN__ 1
188// V8M-MAINLINE-DSP-ALLOW-FP-INSTR: #define __ARM_ARCH_EXT_IDIV__ 1
189// V8M-MAINLINE-DSP-ALLOW-FP-INSTR-NOT: __ARM_ARCH_ISA_ARM
190// V8M-MAINLINE-DSP-ALLOW-FP-INSTR: #define __ARM_ARCH_ISA_THUMB 2
191// V8M-MAINLINE-DSP-ALLOW-FP-INSTR: #define __ARM_ARCH_PROFILE 'M'
192// V8M-MAINLINE-DSP-ALLOW-FP-INSTR-NOT: __ARM_FEATURE_CRC32
193// V8M-MAINLINE-DSP-ALLOW-FP-INSTR: #define __ARM_FEATURE_DSP 1
194// V8M-MAINLINE-DSP-ALLOW-FP-INSTR: #define __ARM_FP 0xe
195// V8M-MAINLINE-DSP-ALLOW-FP-INSTR: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
196
James Y Knight3508b222016-04-01 21:33:20 +0000197// 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 +0000198// CHECK-DEFS:#define __ARM_PCS 1
Bradley Smith0f28f0c2014-01-20 10:52:00 +0000199// CHECK-DEFS:#define __ARM_SIZEOF_MINIMAL_ENUM 4
200// CHECK-DEFS:#define __ARM_SIZEOF_WCHAR_T 4
201
Alexandros Lamprineasf5a8e6c2015-10-02 14:56:37 +0000202// RUN: %clang -target arm-none-linux-gnu -fno-math-errno -fno-signed-zeros\
203// RUN: -fno-trapping-math -fassociative-math -freciprocal-math\
James Y Knight3508b222016-04-01 21:33:20 +0000204// RUN: -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FASTMATH %s
Alexandros Lamprineasf5a8e6c2015-10-02 14:56:37 +0000205// RUN: %clang -target arm-none-linux-gnu -ffast-math -x c -E -dM %s -o -\
James Y Knight3508b222016-04-01 21:33:20 +0000206// RUN: | FileCheck -match-full-lines --check-prefix=CHECK-FASTMATH %s
207// CHECK-FASTMATH: #define __ARM_FP_FAST 1
Alexandros Lamprineasf5a8e6c2015-10-02 14:56:37 +0000208
James Y Knight3508b222016-04-01 21:33:20 +0000209// 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 +0000210// CHECK-SHORTWCHAR:#define __ARM_SIZEOF_WCHAR_T 2
211
James Y Knight3508b222016-04-01 21:33:20 +0000212// 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 +0000213// CHECK-SHORTENUMS:#define __ARM_SIZEOF_MINIMAL_ENUM 1
Silviu Barangae5690462013-10-21 10:59:33 +0000214
215// 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 +0000216// RUN: %clang -target armv7 -mcpu=cortex-a15 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=HWDIV %s
217// RUN: %clang -target armv7 -mthumb -mcpu=cortex-a15 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=HWDIV %s
218// RUN: %clang -target armv7 -mcpu=cortex-a15 -mhwdiv=arm -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=HWDIV %s
219// 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 +0000220// HWDIV:#define __ARM_ARCH_EXT_IDIV__ 1
Silviu Barangae5690462013-10-21 10:59:33 +0000221
James Y Knight3508b222016-04-01 21:33:20 +0000222// RUN: %clang -target arm -mcpu=cortex-a15 -mhwdiv=thumb -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NOHWDIV %s
223// RUN: %clang -target arm -mthumb -mcpu=cortex-a15 -mhwdiv=arm -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NOHWDIV %s
224// RUN: %clang -target arm -mcpu=cortex-a15 -mhwdiv=none -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NOHWDIV %s
225// 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 +0000226// NOHWDIV-NOT:#define __ARM_ARCH_EXT_IDIV__
Silviu Barangae5690462013-10-21 10:59:33 +0000227
Artyom Skrobov53b000a82013-11-21 14:04:38 +0000228
229// Check that -mfpu works properly for Cortex-A7 (enabled by default).
James Y Knight3508b222016-04-01 21:33:20 +0000230// 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
231// 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 +0000232// 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
233// 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 +0000234// DEFAULTFPU-A7:#define __ARM_FP 0xe
Artyom Skrobov53b000a82013-11-21 14:04:38 +0000235// DEFAULTFPU-A7:#define __ARM_NEON__ 1
236// DEFAULTFPU-A7:#define __ARM_VFPV4__ 1
237
James Y Knight3508b222016-04-01 21:33:20 +0000238// 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
239// 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 +0000240// FPUNONE-A7-NOT:#define __ARM_FP 0x{{.*}}
Artyom Skrobov53b000a82013-11-21 14:04:38 +0000241// FPUNONE-A7-NOT:#define __ARM_NEON__ 1
242// FPUNONE-A7-NOT:#define __ARM_VFPV4__ 1
243
James Y Knight3508b222016-04-01 21:33:20 +0000244// 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
245// 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 +0000246// NONEON-A7:#define __ARM_FP 0xe
Artyom Skrobov53b000a82013-11-21 14:04:38 +0000247// NONEON-A7-NOT:#define __ARM_NEON__ 1
248// NONEON-A7:#define __ARM_VFPV4__ 1
249
Amara Emersona1daec72013-11-25 13:18:59 +0000250// Check that -mfpu works properly for Cortex-A5 (enabled by default).
James Y Knight3508b222016-04-01 21:33:20 +0000251// 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
252// 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 +0000253// DEFAULTFPU-A5:#define __ARM_FP 0xe
Amara Emersona1daec72013-11-25 13:18:59 +0000254// DEFAULTFPU-A5:#define __ARM_NEON__ 1
255// DEFAULTFPU-A5:#define __ARM_VFPV4__ 1
256
James Y Knight3508b222016-04-01 21:33:20 +0000257// 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
258// 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 +0000259// FPUNONE-A5-NOT:#define __ARM_FP 0x{{.*}}
Amara Emersona1daec72013-11-25 13:18:59 +0000260// FPUNONE-A5-NOT:#define __ARM_NEON__ 1
261// FPUNONE-A5-NOT:#define __ARM_VFPV4__ 1
262
James Y Knight3508b222016-04-01 21:33:20 +0000263// 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
264// 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 +0000265// NONEON-A5:#define __ARM_FP 0xe
Amara Emersona1daec72013-11-25 13:18:59 +0000266// NONEON-A5-NOT:#define __ARM_NEON__ 1
267// NONEON-A5:#define __ARM_VFPV4__ 1
268
Silviu Barangae5690462013-10-21 10:59:33 +0000269// FIXME: add check for further predefines
Sergey Dmitrouk745f5302014-11-25 08:57:36 +0000270// Test whether predefines are as expected when targeting ep9312.
James Y Knight3508b222016-04-01 21:33:20 +0000271// 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 +0000272// A4T-NOT:#define __ARM_FEATURE_DSP
Richard Barton7dacc242015-10-21 10:03:55 +0000273// A4T-NOT:#define __ARM_FP 0x{{.*}}
Sergey Dmitrouk745f5302014-11-25 08:57:36 +0000274
275// Test whether predefines are as expected when targeting arm10tdmi.
James Y Knight3508b222016-04-01 21:33:20 +0000276// 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 +0000277// A5T-NOT:#define __ARM_FEATURE_DSP
Richard Barton7dacc242015-10-21 10:03:55 +0000278// A5T-NOT:#define __ARM_FP 0x{{.*}}
Sergey Dmitrouk745f5302014-11-25 08:57:36 +0000279
Keith Walker167961f2018-02-19 12:40:26 +0000280// Test whether predefines are as expected when targeting cortex-a5i (soft FP ABI as default).
James Y Knight3508b222016-04-01 21:33:20 +0000281// RUN: %clang -target armv7 -mcpu=cortex-a5 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A5 %s
282// 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 +0000283// A5:#define __ARM_ARCH 7
284// A5:#define __ARM_ARCH_7A__ 1
Artyom Skrobov59f43bb2016-03-23 13:32:33 +0000285// A5-NOT:#define __ARM_ARCH_EXT_IDIV__
Saleem Abdulrasool52a5d412014-06-15 18:48:41 +0000286// A5:#define __ARM_ARCH_PROFILE 'A'
Martell Malonec950c652017-11-29 07:25:12 +0000287// A5-NOT:#define __ARM_DWARF_EH__ 1
James Molloy0ffb0932014-09-15 11:25:38 +0000288// A5-NOT: #define __ARM_FEATURE_DIRECTED_ROUNDING
James Y Knight3508b222016-04-01 21:33:20 +0000289// A5:#define __ARM_FEATURE_DSP 1
Artyom Skrobov59f43bb2016-03-23 13:32:33 +0000290// A5-NOT: #define __ARM_FEATURE_NUMERIC_MAXMIN
Keith Walker167961f2018-02-19 12:40:26 +0000291// A5-NOT:#define __ARM_FP 0x
Amara Emersona1daec72013-11-25 13:18:59 +0000292
Keith Walker167961f2018-02-19 12:40:26 +0000293// Test whether predefines are as expected when targeting cortex-a5 (softfp FP ABI as default).
294// 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
295// 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
296// A5-ALLOW-FP-INSTR:#define __ARM_ARCH 7
297// A5-ALLOW-FP-INSTR:#define __ARM_ARCH_7A__ 1
298// A5-ALLOW-FP-INSTR-NOT:#define __ARM_ARCH_EXT_IDIV__
299// A5-ALLOW-FP-INSTR:#define __ARM_ARCH_PROFILE 'A'
300// A5-ALLOW-FP-INSTR-NOT: #define __ARM_FEATURE_DIRECTED_ROUNDING
301// A5-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
302// A5-ALLOW-FP-INSTR-NOT: #define __ARM_FEATURE_NUMERIC_MAXMIN
303// A5-ALLOW-FP-INSTR:#define __ARM_FP 0xe
304
305// Test whether predefines are as expected when targeting cortex-a7 (soft FP ABI as default).
James Y Knight3508b222016-04-01 21:33:20 +0000306// RUN: %clang -target armv7k -mcpu=cortex-a7 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A7 %s
307// 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 +0000308// A7:#define __ARM_ARCH 7
Artyom Skrobov53b000a82013-11-21 14:04:38 +0000309// A7:#define __ARM_ARCH_EXT_IDIV__ 1
Saleem Abdulrasool52a5d412014-06-15 18:48:41 +0000310// A7:#define __ARM_ARCH_PROFILE 'A'
Martell Malonec950c652017-11-29 07:25:12 +0000311// A7-NOT:#define __ARM_DWARF_EH__ 1
James Y Knight3508b222016-04-01 21:33:20 +0000312// A7:#define __ARM_FEATURE_DSP 1
Keith Walker167961f2018-02-19 12:40:26 +0000313// A7-NOT:#define __ARM_FP 0x
314
315// Test whether predefines are as expected when targeting cortex-a7 (softfp FP ABI as default).
316// 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
317// 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
318// A7-ALLOW-FP-INSTR:#define __ARM_ARCH 7
319// A7-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1
320// A7-ALLOW-FP-INSTR:#define __ARM_ARCH_PROFILE 'A'
321// A7-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
322// A7-ALLOW-FP-INSTR:#define __ARM_FP 0xe
Artyom Skrobov53b000a82013-11-21 14:04:38 +0000323
Tim Northover32617992016-04-28 14:01:49 +0000324// Test whether predefines are as expected when targeting cortex-a7.
325// RUN: %clang -target x86_64-apple-darwin -arch armv7k -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV7K %s
326// ARMV7K:#define __ARM_ARCH 7
327// ARMV7K:#define __ARM_ARCH_EXT_IDIV__ 1
328// ARMV7K:#define __ARM_ARCH_PROFILE 'A'
Chris Bieneman46977b62016-04-29 17:53:00 +0000329// ARMV7K:#define __ARM_DWARF_EH__ 1
Tim Northover32617992016-04-28 14:01:49 +0000330// ARMV7K:#define __ARM_FEATURE_DSP 1
Benjamin Kramer3a13ed62017-12-28 16:58:54 +0000331// ARMV7K:#define __ARM_FP 0xe
Tim Northover32617992016-04-28 14:01:49 +0000332// ARMV7K:#define __ARM_PCS_VFP 1
333
334
Keith Walker167961f2018-02-19 12:40:26 +0000335// Test whether predefines are as expected when targeting cortex-a8 (soft FP ABI as default).
James Y Knight3508b222016-04-01 21:33:20 +0000336// RUN: %clang -target armv7 -mcpu=cortex-a8 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A8 %s
337// 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 +0000338// A8-NOT:#define __ARM_ARCH_EXT_IDIV__
James Y Knight3508b222016-04-01 21:33:20 +0000339// A8:#define __ARM_FEATURE_DSP 1
Keith Walker167961f2018-02-19 12:40:26 +0000340// A8-NOT:#define __ARM_FP 0x
Silviu Barangae5690462013-10-21 10:59:33 +0000341
Keith Walker167961f2018-02-19 12:40:26 +0000342// Test whether predefines are as expected when targeting cortex-a8 (softfp FP ABI as default).
343// 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
344// 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
345// A8-ALLOW-FP-INSTR-NOT:#define __ARM_ARCH_EXT_IDIV__
346// A8-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
347// A8-ALLOW-FP-INSTR:#define __ARM_FP 0xc
348
349// Test whether predefines are as expected when targeting cortex-a9 (soft FP as default).
James Y Knight3508b222016-04-01 21:33:20 +0000350// RUN: %clang -target armv7 -mcpu=cortex-a9 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A9 %s
351// 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 +0000352// A9-NOT:#define __ARM_ARCH_EXT_IDIV__
James Y Knight3508b222016-04-01 21:33:20 +0000353// A9:#define __ARM_FEATURE_DSP 1
Keith Walker167961f2018-02-19 12:40:26 +0000354// A9-NOT:#define __ARM_FP 0x
355
356// Test whether predefines are as expected when targeting cortex-a9 (softfp FP as default).
357// 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
358// 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
359// A9-ALLOW-FP-INSTR-NOT:#define __ARM_ARCH_EXT_IDIV__
360// A9-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
361// A9-ALLOW-FP-INSTR:#define __ARM_FP 0xe
Silviu Barangae5690462013-10-21 10:59:33 +0000362
Richard Barton3b82ed32013-11-22 11:53:28 +0000363
364// Check that -mfpu works properly for Cortex-A12 (enabled by default).
James Y Knight3508b222016-04-01 21:33:20 +0000365// 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
366// 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 +0000367// DEFAULTFPU-A12:#define __ARM_FP 0xe
Richard Barton3b82ed32013-11-22 11:53:28 +0000368// DEFAULTFPU-A12:#define __ARM_NEON__ 1
369// DEFAULTFPU-A12:#define __ARM_VFPV4__ 1
370
James Y Knight3508b222016-04-01 21:33:20 +0000371// 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
372// 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 +0000373// FPUNONE-A12-NOT:#define __ARM_FP 0x{{.*}}
Richard Barton3b82ed32013-11-22 11:53:28 +0000374// FPUNONE-A12-NOT:#define __ARM_NEON__ 1
375// FPUNONE-A12-NOT:#define __ARM_VFPV4__ 1
376
Keith Walker167961f2018-02-19 12:40:26 +0000377// Test whether predefines are as expected when targeting cortex-a12 (soft FP ABI as default).
James Y Knight3508b222016-04-01 21:33:20 +0000378// RUN: %clang -target armv7 -mcpu=cortex-a12 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A12 %s
379// 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 +0000380// A12:#define __ARM_ARCH 7
381// A12:#define __ARM_ARCH_7A__ 1
382// A12:#define __ARM_ARCH_EXT_IDIV__ 1
Saleem Abdulrasool52a5d412014-06-15 18:48:41 +0000383// A12:#define __ARM_ARCH_PROFILE 'A'
James Y Knight3508b222016-04-01 21:33:20 +0000384// A12:#define __ARM_FEATURE_DSP 1
Keith Walker167961f2018-02-19 12:40:26 +0000385// A12-NOT:#define __ARM_FP 0x
Richard Barton3b82ed32013-11-22 11:53:28 +0000386
Keith Walker167961f2018-02-19 12:40:26 +0000387// Test whether predefines are as expected when targeting cortex-a12 (soft FP ABI as default).
388// 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
389// 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
390// A12-ALLOW-FP-INSTR:#define __ARM_ARCH 7
391// A12-ALLOW-FP-INSTR:#define __ARM_ARCH_7A__ 1
392// A12-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1
393// A12-ALLOW-FP-INSTR:#define __ARM_ARCH_PROFILE 'A'
394// A12-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
395// A12-ALLOW-FP-INSTR:#define __ARM_FP 0xe
396
397// Test whether predefines are as expected when targeting cortex-a15 (soft FP ABI as default).
James Y Knight3508b222016-04-01 21:33:20 +0000398// RUN: %clang -target armv7 -mcpu=cortex-a15 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A15 %s
399// 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 +0000400// A15:#define __ARM_ARCH_EXT_IDIV__ 1
James Y Knight3508b222016-04-01 21:33:20 +0000401// A15:#define __ARM_FEATURE_DSP 1
Keith Walker167961f2018-02-19 12:40:26 +0000402// A15-NOT:#define __ARM_FP 0x
403
404// Test whether predefines are as expected when targeting cortex-a15 (softfp ABI as default).
405// 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
406// 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
407// A15-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1
408// A15-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
409// A15-ALLOW-FP-INSTR:#define __ARM_FP 0xe
Silviu Barangae5690462013-10-21 10:59:33 +0000410
Renato Golin5886bc32014-10-13 10:22:48 +0000411// Check that -mfpu works properly for Cortex-A17 (enabled by default).
James Y Knight3508b222016-04-01 21:33:20 +0000412// 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
413// 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 +0000414// DEFAULTFPU-A17:#define __ARM_FP 0xe
Renato Golin5886bc32014-10-13 10:22:48 +0000415// DEFAULTFPU-A17:#define __ARM_NEON__ 1
416// DEFAULTFPU-A17:#define __ARM_VFPV4__ 1
417
James Y Knight3508b222016-04-01 21:33:20 +0000418// 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
419// 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 +0000420// FPUNONE-A17-NOT:#define __ARM_FP 0x{{.*}}
Renato Golin5886bc32014-10-13 10:22:48 +0000421// FPUNONE-A17-NOT:#define __ARM_NEON__ 1
422// FPUNONE-A17-NOT:#define __ARM_VFPV4__ 1
423
Keith Walker167961f2018-02-19 12:40:26 +0000424// Test whether predefines are as expected when targeting cortex-a17 (soft FP ABI as default).
James Y Knight3508b222016-04-01 21:33:20 +0000425// RUN: %clang -target armv7 -mcpu=cortex-a17 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A17 %s
426// 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 +0000427// A17:#define __ARM_ARCH 7
428// A17:#define __ARM_ARCH_7A__ 1
429// A17:#define __ARM_ARCH_EXT_IDIV__ 1
430// A17:#define __ARM_ARCH_PROFILE 'A'
James Y Knight3508b222016-04-01 21:33:20 +0000431// A17:#define __ARM_FEATURE_DSP 1
Keith Walker167961f2018-02-19 12:40:26 +0000432// A17-NOT:#define __ARM_FP 0x
Renato Golin5886bc32014-10-13 10:22:48 +0000433
Keith Walker167961f2018-02-19 12:40:26 +0000434// Test whether predefines are as expected when targeting cortex-a17 (softfp FP ABI as default).
435// 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
436// 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
437// A17-ALLOW-FP-INSTR:#define __ARM_ARCH 7
438// A17-ALLOW-FP-INSTR:#define __ARM_ARCH_7A__ 1
439// A17-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1
440// A17-ALLOW-FP-INSTR:#define __ARM_ARCH_PROFILE 'A'
441// A17-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
442// A17-ALLOW-FP-INSTR:#define __ARM_FP 0xe
443
444// Test whether predefines are as expected when targeting swift (soft FP ABI as default).
James Y Knight3508b222016-04-01 21:33:20 +0000445// RUN: %clang -target armv7s -mcpu=swift -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=SWIFT %s
446// 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 +0000447// SWIFT:#define __ARM_ARCH_EXT_IDIV__ 1
James Y Knight3508b222016-04-01 21:33:20 +0000448// SWIFT:#define __ARM_FEATURE_DSP 1
Keith Walker167961f2018-02-19 12:40:26 +0000449// SWIFT-NOT:#define __ARM_FP 0xxE
Silviu Barangae5690462013-10-21 10:59:33 +0000450
Keith Walker167961f2018-02-19 12:40:26 +0000451// Test whether predefines are as expected when targeting swift (softfp FP ABI as default).
452// RUN: %clang -target armv7s-eabi -mcpu=swift -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=SWIFT-ALLOW-FP-INSTR %s
453// 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
454// SWIFT-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1
455// SWIFT-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
456// SWIFT-ALLOW-FP-INSTR:#define __ARM_FP 0xe
457
458// 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 +0000459// RUN: %clang -target armv8 -mcpu=cortex-a32 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
460// 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 +0000461// RUN: %clang -target armv8 -mcpu=cortex-a35 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
462// 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 +0000463// RUN: %clang -target armv8 -mcpu=cortex-a53 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
464// 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 +0000465// RUN: %clang -target armv8 -mcpu=cortex-a57 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
466// RUN: %clang -target armv8 -mthumb -mcpu=cortex-a57 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
467// RUN: %clang -target armv8 -mcpu=cortex-a72 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
468// 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 +0000469// RUN: %clang -target armv8 -mcpu=cortex-a73 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
470// RUN: %clang -target armv8 -mthumb -mcpu=cortex-a73 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
Artyom Skrobov59f43bb2016-03-23 13:32:33 +0000471// ARMV8:#define __ARM_ARCH_EXT_IDIV__ 1
James Y Knight3508b222016-04-01 21:33:20 +0000472// ARMV8:#define __ARM_FEATURE_DSP 1
Keith Walker167961f2018-02-19 12:40:26 +0000473// ARMV8-NOT:#define __ARM_FP 0x
474
475// Test whether predefines are as expected when targeting ARMv8-A Cortex implementations (softfp FP ABI as default)
476// 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
477// 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
478// 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
479// 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
480// 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
481// 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
482// 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
483// 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
484// 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
485// 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
486// 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
487// 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
488// ARMV8-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1
489// ARMV8-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
490// ARMV8-ALLOW-FP-INSTR:#define __ARM_FP 0xe
Silviu Barangae5690462013-10-21 10:59:33 +0000491
Javed Absar879d18b82015-04-09 14:12:10 +0000492// Test whether predefines are as expected when targeting cortex-r4.
James Y Knight3508b222016-04-01 21:33:20 +0000493// 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 +0000494// R4-ARM-NOT:#define __ARM_ARCH_EXT_IDIV__
James Y Knight3508b222016-04-01 21:33:20 +0000495// R4-ARM:#define __ARM_FEATURE_DSP 1
Richard Barton7dacc242015-10-21 10:03:55 +0000496// R4-ARM-NOT:#define __ARM_FP 0x{{.*}}
Javed Absar879d18b82015-04-09 14:12:10 +0000497
James Y Knight3508b222016-04-01 21:33:20 +0000498// 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 +0000499// R4-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
James Y Knight3508b222016-04-01 21:33:20 +0000500// R4-THUMB:#define __ARM_FEATURE_DSP 1
Richard Barton7dacc242015-10-21 10:03:55 +0000501// R4-THUMB-NOT:#define __ARM_FP 0x{{.*}}
Javed Absar879d18b82015-04-09 14:12:10 +0000502
Keith Walker167961f2018-02-19 12:40:26 +0000503// Test whether predefines are as expected when targeting cortex-r4f (soft FP ABI as default).
James Y Knight3508b222016-04-01 21:33:20 +0000504// 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 +0000505// R4F-ARM-NOT:#define __ARM_ARCH_EXT_IDIV__
James Y Knight3508b222016-04-01 21:33:20 +0000506// R4F-ARM:#define __ARM_FEATURE_DSP 1
Keith Walker167961f2018-02-19 12:40:26 +0000507// R4F-ARM-NOT:#define __ARM_FP 0x
508
509// Test whether predefines are as expected when targeting cortex-r4f (softfp FP ABI as default).
510// 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
511// R4F-ARM-ALLOW-FP-INSTR-NOT:#define __ARM_ARCH_EXT_IDIV__
512// R4F-ARM-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
513// R4F-ARM-ALLOW-FP-INSTR:#define __ARM_FP 0xc
Javed Absar879d18b82015-04-09 14:12:10 +0000514
James Y Knight3508b222016-04-01 21:33:20 +0000515// 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 +0000516// R4F-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
James Y Knight3508b222016-04-01 21:33:20 +0000517// R4F-THUMB:#define __ARM_FEATURE_DSP 1
Keith Walker167961f2018-02-19 12:40:26 +0000518// R4F-THUMB-NOT:#define __ARM_FP 0x
Javed Absar879d18b82015-04-09 14:12:10 +0000519
Keith Walker167961f2018-02-19 12:40:26 +0000520// 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
521// R4F-THUMB-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1
522// R4F-THUMB-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
523// R4F-THUMB-ALLOW-FP-INSTR:#define __ARM_FP 0xc
524
525// Test whether predefines are as expected when targeting cortex-r5 (soft FP ABI as default).
James Y Knight3508b222016-04-01 21:33:20 +0000526// RUN: %clang -target armv7 -mcpu=cortex-r5 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R5 %s
527// 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 +0000528// R5:#define __ARM_ARCH_EXT_IDIV__ 1
James Y Knight3508b222016-04-01 21:33:20 +0000529// R5:#define __ARM_FEATURE_DSP 1
Keith Walker167961f2018-02-19 12:40:26 +0000530// R5-NOT:#define __ARM_FP 0x
Silviu Barangae5690462013-10-21 10:59:33 +0000531
Keith Walker167961f2018-02-19 12:40:26 +0000532// Test whether predefines are as expected when targeting cortex-r5 (softfp FP ABI as default).
533// 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
534// 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
535// R5-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1
536// R5-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
537// R5-ALLOW-FP-INSTR:#define __ARM_FP 0xc
538
539// 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 +0000540// RUN: %clang -target armv7 -mcpu=cortex-r7 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R7-R8 %s
541// RUN: %clang -target armv7 -mthumb -mcpu=cortex-r7 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R7-R8 %s
542// RUN: %clang -target armv7 -mcpu=cortex-r8 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R7-R8 %s
543// 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 +0000544// R7-R8:#define __ARM_ARCH_EXT_IDIV__ 1
James Y Knight3508b222016-04-01 21:33:20 +0000545// R7-R8:#define __ARM_FEATURE_DSP 1
Keith Walker167961f2018-02-19 12:40:26 +0000546// R7-R8-NOT:#define __ARM_FP 0x
547
548// Test whether predefines are as expected when targeting cortex-r7 and cortex-r8 (softfp FP ABI as default).
549// 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
550// 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
551// 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
552// 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
553// R7-R8-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1
554// R7-R8-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
555// R7-R8-ALLOW-FP-INSTR:#define __ARM_FP 0xe
Bradley Smithd86d6702015-02-18 10:34:48 +0000556
Silviu Barangae5690462013-10-21 10:59:33 +0000557// Test whether predefines are as expected when targeting cortex-m0.
James Y Knight3508b222016-04-01 21:33:20 +0000558// RUN: %clang -target armv7 -mthumb -mcpu=cortex-m0 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M0-THUMB %s
559// RUN: %clang -target armv7 -mthumb -mcpu=cortex-m0plus -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M0-THUMB %s
560// RUN: %clang -target armv7 -mthumb -mcpu=cortex-m1 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M0-THUMB %s
561// 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 +0000562// M0-THUMB-NOT:#define __ARM_ARCH_EXT_IDIV__
Sergey Dmitrouk745f5302014-11-25 08:57:36 +0000563// M0-THUMB-NOT:#define __ARM_FEATURE_DSP
Richard Barton7dacc242015-10-21 10:03:55 +0000564// M0-THUMB-NOT:#define __ARM_FP 0x{{.*}}
Silviu Barangae5690462013-10-21 10:59:33 +0000565
566// Test whether predefines are as expected when targeting cortex-m3.
James Y Knight3508b222016-04-01 21:33:20 +0000567// RUN: %clang -target armv7 -mthumb -mcpu=cortex-m3 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M3-THUMB %s
568// 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 +0000569// M3-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
Sergey Dmitrouk745f5302014-11-25 08:57:36 +0000570// M3-THUMB-NOT:#define __ARM_FEATURE_DSP
Richard Barton7dacc242015-10-21 10:03:55 +0000571// M3-THUMB-NOT:#define __ARM_FP 0x{{.*}}
Silviu Barangae5690462013-10-21 10:59:33 +0000572
Keith Walker167961f2018-02-19 12:40:26 +0000573// Test whether predefines are as expected when targeting cortex-m4 (soft FP ABI as default).
James Y Knight3508b222016-04-01 21:33:20 +0000574// 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 +0000575// M4-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
James Y Knight3508b222016-04-01 21:33:20 +0000576// M4-THUMB:#define __ARM_FEATURE_DSP 1
Keith Walker167961f2018-02-19 12:40:26 +0000577// M4-THUMB-NOT:#define __ARM_FP 0x
Ana Pazosdd6068d2013-12-06 22:43:17 +0000578
Keith Walker167961f2018-02-19 12:40:26 +0000579// Test whether predefines are as expected when targeting cortex-m4 (softfp ABI as default).
580// 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
581// M4-THUMB-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1
582// M4-THUMB-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
583// M4-THUMB-ALLOW-FP-INSTR:#define __ARM_FP 0x6
584
585// Test whether predefines are as expected when targeting cortex-m7 (soft FP ABI as default).
James Y Knight3508b222016-04-01 21:33:20 +0000586// 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 +0000587// M7-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
James Y Knight3508b222016-04-01 21:33:20 +0000588// M7-THUMB:#define __ARM_FEATURE_DSP 1
Keith Walker167961f2018-02-19 12:40:26 +0000589// M7-THUMB-NOT:#define __ARM_FP 0x
590// M7-THUMB-NOT:#define __ARM_FPV5__
591
592// Test whether predefines are as expected when targeting cortex-m7 (softfp FP ABI as default).
593// 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
594// M7-THUMB-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1
595// M7-THUMB-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
596// M7-THUMB-ALLOW-FP-INSTR:#define __ARM_FP 0xe
597// M7-THUMB-ALLOW-FP-INSTR:#define __ARM_FPV5__ 1
Oliver Stannardbfd3ea32014-10-01 09:03:02 +0000598
Sanne Wouda0479e692017-02-20 10:37:01 +0000599// Test whether predefines are as expected when targeting v8m cores
600// RUN: %clang -target arm -mcpu=cortex-m23 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M23 %s
601// M23: #define __ARM_ARCH 8
602// M23: #define __ARM_ARCH_8M_BASE__ 1
603// M23: #define __ARM_ARCH_EXT_IDIV__ 1
604// M23-NOT: __ARM_ARCH_ISA_ARM
605// M23: #define __ARM_ARCH_ISA_THUMB 1
606// M23: #define __ARM_ARCH_PROFILE 'M'
607// M23-NOT: __ARM_FEATURE_CRC32
608// M23-NOT: __ARM_FEATURE_DSP
609// M23-NOT: __ARM_FP 0x{{.*}}
610// M23-NOT: __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1
611
Keith Walker167961f2018-02-19 12:40:26 +0000612// Test whether predefines are as expected when targeting m33 (soft FP ABI as default).
Sanne Wouda0479e692017-02-20 10:37:01 +0000613// RUN: %clang -target arm -mcpu=cortex-m33 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M33 %s
614// M33: #define __ARM_ARCH 8
615// M33: #define __ARM_ARCH_8M_MAIN__ 1
616// M33: #define __ARM_ARCH_EXT_IDIV__ 1
617// M33-NOT: __ARM_ARCH_ISA_ARM
618// M33: #define __ARM_ARCH_ISA_THUMB 2
619// M33: #define __ARM_ARCH_PROFILE 'M'
620// M33-NOT: __ARM_FEATURE_CRC32
621// M33: #define __ARM_FEATURE_DSP 1
Keith Walker167961f2018-02-19 12:40:26 +0000622// M33-NOT: #define __ARM_FP 0x
Sanne Wouda0479e692017-02-20 10:37:01 +0000623// M33: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
624
Keith Walker167961f2018-02-19 12:40:26 +0000625// Test whether predefines are as expected when targeting m33 (softfp FP ABI as default).
626// 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
627// M33-ALLOW-FP-INSTR: #define __ARM_ARCH 8
628// M33-ALLOW-FP-INSTR: #define __ARM_ARCH_8M_MAIN__ 1
629// M33-ALLOW-FP-INSTR: #define __ARM_ARCH_EXT_IDIV__ 1
630// M33-ALLOW-FP-INSTR-NOT: __ARM_ARCH_ISA_ARM
631// M33-ALLOW-FP-INSTR: #define __ARM_ARCH_ISA_THUMB 2
632// M33-ALLOW-FP-INSTR: #define __ARM_ARCH_PROFILE 'M'
633// M33-ALLOW-FP-INSTR-NOT: __ARM_FEATURE_CRC32
634// M33-ALLOW-FP-INSTR: #define __ARM_FEATURE_DSP 1
635// M33-ALLOW-FP-INSTR: #define __ARM_FP 0x6
636// M33-ALLOW-FP-INSTR: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
637
638// Test whether predefines are as expected when targeting krait (soft FP as default).
James Y Knight3508b222016-04-01 21:33:20 +0000639// RUN: %clang -target armv7 -mcpu=krait -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=KRAIT %s
640// 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 +0000641// KRAIT:#define __ARM_ARCH_EXT_IDIV__ 1
James Y Knight3508b222016-04-01 21:33:20 +0000642// KRAIT:#define __ARM_FEATURE_DSP 1
Keith Walker167961f2018-02-19 12:40:26 +0000643// KRAIT-NOT:#define __ARM_VFPV4__
644
645// Test whether predefines are as expected when targeting krait (softfp FP as default).
646// RUN: %clang -target armv7-eabi -mcpu=krait -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=KRAIT-ALLOW-FP-INSTR %s
647// 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
648// KRAIT-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1
649// KRAIT-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1
650// KRAIT-ALLOW-FP-INSTR:#define __ARM_VFPV4__ 1
Vladimir Sukharevc6dab752015-05-14 08:25:18 +0000651
James Y Knight3508b222016-04-01 21:33:20 +0000652// RUN: %clang -target armv8.1a-none-none-eabi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V81A %s
653// CHECK-V81A: #define __ARM_ARCH 8
654// CHECK-V81A: #define __ARM_ARCH_8_1A__ 1
Vladimir Sukharevc6dab752015-05-14 08:25:18 +0000655// CHECK-V81A: #define __ARM_ARCH_PROFILE 'A'
James Y Knight3508b222016-04-01 21:33:20 +0000656// CHECK-V81A: #define __ARM_FEATURE_QRDMX 1
Benjamin Kramer3a13ed62017-12-28 16:58:54 +0000657// CHECK-V81A: #define __ARM_FP 0xe
Oliver Stannard3086c042016-02-11 16:05:52 +0000658
James Y Knight3508b222016-04-01 21:33:20 +0000659// RUN: %clang -target armv8.2a-none-none-eabi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V82A %s
660// CHECK-V82A: #define __ARM_ARCH 8
661// CHECK-V82A: #define __ARM_ARCH_8_2A__ 1
Oliver Stannard3086c042016-02-11 16:05:52 +0000662// CHECK-V82A: #define __ARM_ARCH_PROFILE 'A'
Sjoerd Meijercb75f612017-06-30 08:07:34 +0000663// CHECK-V82A: #define __ARM_FEATURE_QRDMX 1
Benjamin Kramer3a13ed62017-12-28 16:58:54 +0000664// CHECK-V82A: #define __ARM_FP 0xe