blob: f45c5ba07f0fd373b040f41b948c66ac60b62df2 [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
8// CHECK-V8A: #define __ARM_FP 0xE
9// CHECK-V8A: #define __ARM_FP16_ARGS 1
10// CHECK-V8A: #define __ARM_FP16_FORMAT_IEEE 1
Joey Gouly1e8637b2013-09-18 10:07:09 +000011
Javed Absar00b74442016-10-07 12:08:41 +000012// RUN: %clang -target armv8r-none-linux-gnu -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V8R %s
13// CHECK-V8R: #define __ARMEL__ 1
14// CHECK-V8R: #define __ARM_ARCH 8
15// CHECK-V8R: #define __ARM_ARCH_8R__ 1
16// CHECK-V8R: #define __ARM_FEATURE_CRC32 1
17// CHECK-V8R: #define __ARM_FEATURE_DIRECTED_ROUNDING 1
18// CHECK-V8R: #define __ARM_FEATURE_NUMERIC_MAXMIN 1
19// CHECK-V8R: #define __ARM_FP 0xE
20
James Y Knight3508b222016-04-01 21:33:20 +000021// RUN: %clang -target armv7a-none-linux-gnu -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V7 %s
22// CHECK-V7: #define __ARMEL__ 1
23// CHECK-V7: #define __ARM_ARCH 7
24// CHECK-V7: #define __ARM_ARCH_7A__ 1
Nico Riecke6a158252014-02-16 07:29:41 +000025// CHECK-V7-NOT: __ARM_FEATURE_CRC32
Pablo Barrio1c1b2512016-03-15 19:03:09 +000026// CHECK-V7-NOT: __ARM_FEATURE_NUMERIC_MAXMIN
James Molloy0ffb0932014-09-15 11:25:38 +000027// CHECK-V7-NOT: __ARM_FEATURE_DIRECTED_ROUNDING
James Y Knight3508b222016-04-01 21:33:20 +000028// CHECK-V7: #define __ARM_FP 0xC
Silviu Barangae5690462013-10-21 10:59:33 +000029
James Y Knight3508b222016-04-01 21:33:20 +000030// 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
31// CHECK-V7S: #define __ARMEL__ 1
32// CHECK-V7S: #define __ARM_ARCH 7
33// CHECK-V7S: #define __ARM_ARCH_7S__ 1
Tim Northover525c73c2015-07-21 21:47:33 +000034// CHECK-V7S-NOT: __ARM_FEATURE_CRC32
35// CHECK-V7S-NOT: __ARM_FEATURE_NUMERIC_MAXMIN
36// CHECK-V7S-NOT: __ARM_FEATURE_DIRECTED_ROUNDING
James Y Knight3508b222016-04-01 21:33:20 +000037// CHECK-V7S: #define __ARM_FP 0xE
Tim Northover525c73c2015-07-21 21:47:33 +000038
James Y Knight3508b222016-04-01 21:33:20 +000039// RUN: %clang -target armv8a -mfloat-abi=hard -x c -E -dM %s | FileCheck -match-full-lines --check-prefix=CHECK-V8-BAREHF %s
40// CHECK-V8-BAREHF: #define __ARMEL__ 1
41// CHECK-V8-BAREHF: #define __ARM_ARCH 8
42// CHECK-V8-BAREHF: #define __ARM_ARCH_8A__ 1
43// CHECK-V8-BAREHF: #define __ARM_FEATURE_CRC32 1
44// CHECK-V8-BAREHF: #define __ARM_FEATURE_DIRECTED_ROUNDING 1
45// CHECK-V8-BAREHF: #define __ARM_FEATURE_NUMERIC_MAXMIN 1
46// CHECK-V8-BAREHP: #define __ARM_FP 0xE
47// CHECK-V8-BAREHF: #define __ARM_NEON__ 1
48// CHECK-V8-BAREHF: #define __ARM_PCS_VFP 1
49// CHECK-V8-BAREHF: #define __VFP_FP__ 1
Bernard Ogdenda13af32013-10-24 18:32:51 +000050
James Y Knight3508b222016-04-01 21:33:20 +000051// 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 +000052// CHECK-V8-BAREHF-FP-NOT: __ARM_NEON__ 1
James Y Knight3508b222016-04-01 21:33:20 +000053// CHECK-V8-BAREHP-FP: #define __ARM_FP 0xE
54// CHECK-V8-BAREHF-FP: #define __VFP_FP__ 1
Bernard Ogdenda13af32013-10-24 18:32:51 +000055
James Y Knight3508b222016-04-01 21:33:20 +000056// 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
57// 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
58// CHECK-V8-BAREHP-NEON-FP: #define __ARM_FP 0xE
59// CHECK-V8-BAREHF-NEON-FP: #define __ARM_NEON__ 1
60// CHECK-V8-BAREHF-NEON-FP: #define __VFP_FP__ 1
Bernard Ogdenda13af32013-10-24 18:32:51 +000061
James Y Knight3508b222016-04-01 21:33:20 +000062// 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 +000063// CHECK-V8-NOCRC-NOT: __ARM_FEATURE_CRC32 1
64
Silviu Barangae5690462013-10-21 10:59:33 +000065// Check that -mhwdiv works properly for armv8/thumbv8 (enabled by default).
66
James Y Knight3508b222016-04-01 21:33:20 +000067// RUN: %clang -target armv8 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8 %s
68// RUN: %clang -target armv8 -mthumb -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8 %s
69// RUN: %clang -target armv8-eabi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8 %s
70// 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 +000071// V8:#define __ARM_ARCH_EXT_IDIV__ 1
Silviu Barangae5690462013-10-21 10:59:33 +000072
James Y Knight3508b222016-04-01 21:33:20 +000073// RUN: %clang -target armv8 -mhwdiv=none -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NOHWDIV-V8 %s
74// RUN: %clang -target armv8 -mthumb -mhwdiv=none -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NOHWDIV-V8 %s
75// RUN: %clang -target armv8 -mhwdiv=thumb -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NOHWDIV-V8 %s
76// 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 +000077// NOHWDIV-V8-NOT:#define __ARM_ARCH_EXT_IDIV__
Silviu Barangae5690462013-10-21 10:59:33 +000078
James Y Knight3508b222016-04-01 21:33:20 +000079// RUN: %clang -target armv8a -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8A %s
80// RUN: %clang -target armv8a -mthumb -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8A %s
81// RUN: %clang -target armv8a-eabi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8A %s
82// RUN: %clang -target armv8a-eabi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8A %s
Artyom Skrobov59f43bb2016-03-23 13:32:33 +000083// V8A:#define __ARM_ARCH_EXT_IDIV__ 1
84// V8A:#define __ARM_FP 0xE
Silviu Barangae5690462013-10-21 10:59:33 +000085
James Y Knight3508b222016-04-01 21:33:20 +000086// RUN: %clang -target armv8m.base-none-linux-gnu -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8M_BASELINE %s
87// V8M_BASELINE: #define __ARM_ARCH 8
88// V8M_BASELINE: #define __ARM_ARCH_8M_BASE__ 1
89// V8M_BASELINE: #define __ARM_ARCH_EXT_IDIV__ 1
Bradley Smithf4affc12016-03-03 13:52:22 +000090// V8M_BASELINE-NOT: __ARM_ARCH_ISA_ARM
James Y Knight3508b222016-04-01 21:33:20 +000091// V8M_BASELINE: #define __ARM_ARCH_ISA_THUMB 1
92// V8M_BASELINE: #define __ARM_ARCH_PROFILE 'M'
Bradley Smithf4affc12016-03-03 13:52:22 +000093// V8M_BASELINE-NOT: __ARM_FEATURE_CRC32
94// V8M_BASELINE-NOT: __ARM_FEATURE_DSP
95// V8M_BASELINE-NOT: __ARM_FP 0x{{.*}}
96// V8M_BASELINE-NOT: __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1
97
James Y Knight3508b222016-04-01 21:33:20 +000098// RUN: %clang -target armv8m.main-none-linux-gnu -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8M_MAINLINE %s
99// V8M_MAINLINE: #define __ARM_ARCH 8
100// V8M_MAINLINE: #define __ARM_ARCH_8M_MAIN__ 1
101// V8M_MAINLINE: #define __ARM_ARCH_EXT_IDIV__ 1
Bradley Smithf4affc12016-03-03 13:52:22 +0000102// V8M_MAINLINE-NOT: __ARM_ARCH_ISA_ARM
James Y Knight3508b222016-04-01 21:33:20 +0000103// V8M_MAINLINE: #define __ARM_ARCH_ISA_THUMB 2
104// V8M_MAINLINE: #define __ARM_ARCH_PROFILE 'M'
Bradley Smithf4affc12016-03-03 13:52:22 +0000105// V8M_MAINLINE-NOT: __ARM_FEATURE_CRC32
106// V8M_MAINLINE-NOT: __ARM_FEATURE_DSP
James Y Knight3508b222016-04-01 21:33:20 +0000107// V8M_MAINLINE: #define __ARM_FP 0xE
108// V8M_MAINLINE: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
Bradley Smithf4affc12016-03-03 13:52:22 +0000109
James Y Knight3508b222016-04-01 21:33:20 +0000110// 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
111// V8M_MAINLINE_DSP: #define __ARM_ARCH 8
112// V8M_MAINLINE_DSP: #define __ARM_ARCH_8M_MAIN__ 1
113// V8M_MAINLINE_DSP: #define __ARM_ARCH_EXT_IDIV__ 1
Bradley Smithf4affc12016-03-03 13:52:22 +0000114// V8M_MAINLINE_DSP-NOT: __ARM_ARCH_ISA_ARM
James Y Knight3508b222016-04-01 21:33:20 +0000115// V8M_MAINLINE_DSP: #define __ARM_ARCH_ISA_THUMB 2
116// V8M_MAINLINE_DSP: #define __ARM_ARCH_PROFILE 'M'
Bradley Smithf4affc12016-03-03 13:52:22 +0000117// V8M_MAINLINE_DSP-NOT: __ARM_FEATURE_CRC32
James Y Knight3508b222016-04-01 21:33:20 +0000118// V8M_MAINLINE_DSP: #define __ARM_FEATURE_DSP 1
119// V8M_MAINLINE_DSP: #define __ARM_FP 0xE
120// V8M_MAINLINE_DSP: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
Bradley Smithf4affc12016-03-03 13:52:22 +0000121
James Y Knight3508b222016-04-01 21:33:20 +0000122// 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 +0000123// CHECK-DEFS:#define __ARM_PCS 1
Bradley Smith0f28f0c2014-01-20 10:52:00 +0000124// CHECK-DEFS:#define __ARM_SIZEOF_MINIMAL_ENUM 4
125// CHECK-DEFS:#define __ARM_SIZEOF_WCHAR_T 4
126
Alexandros Lamprineasf5a8e6c2015-10-02 14:56:37 +0000127// RUN: %clang -target arm-none-linux-gnu -fno-math-errno -fno-signed-zeros\
128// RUN: -fno-trapping-math -fassociative-math -freciprocal-math\
James Y Knight3508b222016-04-01 21:33:20 +0000129// RUN: -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FASTMATH %s
Alexandros Lamprineasf5a8e6c2015-10-02 14:56:37 +0000130// RUN: %clang -target arm-none-linux-gnu -ffast-math -x c -E -dM %s -o -\
James Y Knight3508b222016-04-01 21:33:20 +0000131// RUN: | FileCheck -match-full-lines --check-prefix=CHECK-FASTMATH %s
132// CHECK-FASTMATH: #define __ARM_FP_FAST 1
Alexandros Lamprineasf5a8e6c2015-10-02 14:56:37 +0000133
James Y Knight3508b222016-04-01 21:33:20 +0000134// 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 +0000135// CHECK-SHORTWCHAR:#define __ARM_SIZEOF_WCHAR_T 2
136
James Y Knight3508b222016-04-01 21:33:20 +0000137// 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 +0000138// CHECK-SHORTENUMS:#define __ARM_SIZEOF_MINIMAL_ENUM 1
Silviu Barangae5690462013-10-21 10:59:33 +0000139
140// 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 +0000141// RUN: %clang -target armv7 -mcpu=cortex-a15 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=HWDIV %s
142// RUN: %clang -target armv7 -mthumb -mcpu=cortex-a15 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=HWDIV %s
143// RUN: %clang -target armv7 -mcpu=cortex-a15 -mhwdiv=arm -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=HWDIV %s
144// 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 +0000145// HWDIV:#define __ARM_ARCH_EXT_IDIV__ 1
Silviu Barangae5690462013-10-21 10:59:33 +0000146
James Y Knight3508b222016-04-01 21:33:20 +0000147// RUN: %clang -target arm -mcpu=cortex-a15 -mhwdiv=thumb -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NOHWDIV %s
148// RUN: %clang -target arm -mthumb -mcpu=cortex-a15 -mhwdiv=arm -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NOHWDIV %s
149// RUN: %clang -target arm -mcpu=cortex-a15 -mhwdiv=none -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NOHWDIV %s
150// 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 +0000151// NOHWDIV-NOT:#define __ARM_ARCH_EXT_IDIV__
Silviu Barangae5690462013-10-21 10:59:33 +0000152
Artyom Skrobov53b000a82013-11-21 14:04:38 +0000153
154// Check that -mfpu works properly for Cortex-A7 (enabled by default).
James Y Knight3508b222016-04-01 21:33:20 +0000155// 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
156// 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
Richard Barton7dacc242015-10-21 10:03:55 +0000157// DEFAULTFPU-A7:#define __ARM_FP 0xE
Artyom Skrobov53b000a82013-11-21 14:04:38 +0000158// DEFAULTFPU-A7:#define __ARM_NEON__ 1
159// DEFAULTFPU-A7:#define __ARM_VFPV4__ 1
160
James Y Knight3508b222016-04-01 21:33:20 +0000161// 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
162// 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 +0000163// FPUNONE-A7-NOT:#define __ARM_FP 0x{{.*}}
Artyom Skrobov53b000a82013-11-21 14:04:38 +0000164// FPUNONE-A7-NOT:#define __ARM_NEON__ 1
165// FPUNONE-A7-NOT:#define __ARM_VFPV4__ 1
166
James Y Knight3508b222016-04-01 21:33:20 +0000167// 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
168// 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
Richard Barton7dacc242015-10-21 10:03:55 +0000169// NONEON-A7:#define __ARM_FP 0xE
Artyom Skrobov53b000a82013-11-21 14:04:38 +0000170// NONEON-A7-NOT:#define __ARM_NEON__ 1
171// NONEON-A7:#define __ARM_VFPV4__ 1
172
Amara Emersona1daec72013-11-25 13:18:59 +0000173// Check that -mfpu works properly for Cortex-A5 (enabled by default).
James Y Knight3508b222016-04-01 21:33:20 +0000174// 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
175// 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
Richard Barton7dacc242015-10-21 10:03:55 +0000176// DEFAULTFPU-A5:#define __ARM_FP 0xE
Amara Emersona1daec72013-11-25 13:18:59 +0000177// DEFAULTFPU-A5:#define __ARM_NEON__ 1
178// DEFAULTFPU-A5:#define __ARM_VFPV4__ 1
179
James Y Knight3508b222016-04-01 21:33:20 +0000180// 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
181// 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 +0000182// FPUNONE-A5-NOT:#define __ARM_FP 0x{{.*}}
Amara Emersona1daec72013-11-25 13:18:59 +0000183// FPUNONE-A5-NOT:#define __ARM_NEON__ 1
184// FPUNONE-A5-NOT:#define __ARM_VFPV4__ 1
185
James Y Knight3508b222016-04-01 21:33:20 +0000186// 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
187// 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
Richard Barton7dacc242015-10-21 10:03:55 +0000188// NONEON-A5:#define __ARM_FP 0xE
Amara Emersona1daec72013-11-25 13:18:59 +0000189// NONEON-A5-NOT:#define __ARM_NEON__ 1
190// NONEON-A5:#define __ARM_VFPV4__ 1
191
Silviu Barangae5690462013-10-21 10:59:33 +0000192// FIXME: add check for further predefines
Sergey Dmitrouk745f5302014-11-25 08:57:36 +0000193// Test whether predefines are as expected when targeting ep9312.
James Y Knight3508b222016-04-01 21:33:20 +0000194// 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 +0000195// A4T-NOT:#define __ARM_FEATURE_DSP
Richard Barton7dacc242015-10-21 10:03:55 +0000196// A4T-NOT:#define __ARM_FP 0x{{.*}}
Sergey Dmitrouk745f5302014-11-25 08:57:36 +0000197
198// Test whether predefines are as expected when targeting arm10tdmi.
James Y Knight3508b222016-04-01 21:33:20 +0000199// 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 +0000200// A5T-NOT:#define __ARM_FEATURE_DSP
Richard Barton7dacc242015-10-21 10:03:55 +0000201// A5T-NOT:#define __ARM_FP 0x{{.*}}
Sergey Dmitrouk745f5302014-11-25 08:57:36 +0000202
Silviu Barangae5690462013-10-21 10:59:33 +0000203// Test whether predefines are as expected when targeting cortex-a5.
James Y Knight3508b222016-04-01 21:33:20 +0000204// RUN: %clang -target armv7 -mcpu=cortex-a5 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A5 %s
205// 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 +0000206// A5:#define __ARM_ARCH 7
207// A5:#define __ARM_ARCH_7A__ 1
Artyom Skrobov59f43bb2016-03-23 13:32:33 +0000208// A5-NOT:#define __ARM_ARCH_EXT_IDIV__
Saleem Abdulrasool52a5d412014-06-15 18:48:41 +0000209// A5:#define __ARM_ARCH_PROFILE 'A'
James Molloy0ffb0932014-09-15 11:25:38 +0000210// A5-NOT: #define __ARM_FEATURE_DIRECTED_ROUNDING
James Y Knight3508b222016-04-01 21:33:20 +0000211// A5:#define __ARM_FEATURE_DSP 1
Artyom Skrobov59f43bb2016-03-23 13:32:33 +0000212// A5-NOT: #define __ARM_FEATURE_NUMERIC_MAXMIN
Richard Barton7dacc242015-10-21 10:03:55 +0000213// A5:#define __ARM_FP 0xE
Amara Emersona1daec72013-11-25 13:18:59 +0000214
Artyom Skrobov53b000a82013-11-21 14:04:38 +0000215// Test whether predefines are as expected when targeting cortex-a7.
James Y Knight3508b222016-04-01 21:33:20 +0000216// RUN: %clang -target armv7k -mcpu=cortex-a7 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A7 %s
217// 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 +0000218// A7:#define __ARM_ARCH 7
Artyom Skrobov53b000a82013-11-21 14:04:38 +0000219// A7:#define __ARM_ARCH_EXT_IDIV__ 1
Saleem Abdulrasool52a5d412014-06-15 18:48:41 +0000220// A7:#define __ARM_ARCH_PROFILE 'A'
James Y Knight3508b222016-04-01 21:33:20 +0000221// A7:#define __ARM_FEATURE_DSP 1
Richard Barton7dacc242015-10-21 10:03:55 +0000222// A7:#define __ARM_FP 0xE
Artyom Skrobov53b000a82013-11-21 14:04:38 +0000223
Tim Northover32617992016-04-28 14:01:49 +0000224// Test whether predefines are as expected when targeting cortex-a7.
225// RUN: %clang -target x86_64-apple-darwin -arch armv7k -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV7K %s
226// ARMV7K:#define __ARM_ARCH 7
227// ARMV7K:#define __ARM_ARCH_EXT_IDIV__ 1
228// ARMV7K:#define __ARM_ARCH_PROFILE 'A'
Chris Bieneman46977b62016-04-29 17:53:00 +0000229// ARMV7K:#define __ARM_DWARF_EH__ 1
Tim Northover32617992016-04-28 14:01:49 +0000230// ARMV7K:#define __ARM_FEATURE_DSP 1
231// ARMV7K:#define __ARM_FP 0xE
232// ARMV7K:#define __ARM_PCS_VFP 1
233
234
Silviu Barangae5690462013-10-21 10:59:33 +0000235// Test whether predefines are as expected when targeting cortex-a8.
James Y Knight3508b222016-04-01 21:33:20 +0000236// RUN: %clang -target armv7 -mcpu=cortex-a8 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A8 %s
237// 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 +0000238// A8-NOT:#define __ARM_ARCH_EXT_IDIV__
James Y Knight3508b222016-04-01 21:33:20 +0000239// A8:#define __ARM_FEATURE_DSP 1
Artyom Skrobov59f43bb2016-03-23 13:32:33 +0000240// A8:#define __ARM_FP 0xC
Silviu Barangae5690462013-10-21 10:59:33 +0000241
242// Test whether predefines are as expected when targeting cortex-a9.
James Y Knight3508b222016-04-01 21:33:20 +0000243// RUN: %clang -target armv7 -mcpu=cortex-a9 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A9 %s
244// 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 +0000245// A9-NOT:#define __ARM_ARCH_EXT_IDIV__
James Y Knight3508b222016-04-01 21:33:20 +0000246// A9:#define __ARM_FEATURE_DSP 1
Artyom Skrobov59f43bb2016-03-23 13:32:33 +0000247// A9:#define __ARM_FP 0xE
Silviu Barangae5690462013-10-21 10:59:33 +0000248
Richard Barton3b82ed32013-11-22 11:53:28 +0000249
250// Check that -mfpu works properly for Cortex-A12 (enabled by default).
James Y Knight3508b222016-04-01 21:33:20 +0000251// 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
252// 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
Richard Barton7dacc242015-10-21 10:03:55 +0000253// DEFAULTFPU-A12:#define __ARM_FP 0xE
Richard Barton3b82ed32013-11-22 11:53:28 +0000254// DEFAULTFPU-A12:#define __ARM_NEON__ 1
255// DEFAULTFPU-A12:#define __ARM_VFPV4__ 1
256
James Y Knight3508b222016-04-01 21:33:20 +0000257// 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
258// 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 +0000259// FPUNONE-A12-NOT:#define __ARM_FP 0x{{.*}}
Richard Barton3b82ed32013-11-22 11:53:28 +0000260// FPUNONE-A12-NOT:#define __ARM_NEON__ 1
261// FPUNONE-A12-NOT:#define __ARM_VFPV4__ 1
262
263// Test whether predefines are as expected when targeting cortex-a12.
James Y Knight3508b222016-04-01 21:33:20 +0000264// RUN: %clang -target armv7 -mcpu=cortex-a12 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A12 %s
265// 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 +0000266// A12:#define __ARM_ARCH 7
267// A12:#define __ARM_ARCH_7A__ 1
268// A12:#define __ARM_ARCH_EXT_IDIV__ 1
Saleem Abdulrasool52a5d412014-06-15 18:48:41 +0000269// A12:#define __ARM_ARCH_PROFILE 'A'
James Y Knight3508b222016-04-01 21:33:20 +0000270// A12:#define __ARM_FEATURE_DSP 1
Richard Barton7dacc242015-10-21 10:03:55 +0000271// A12:#define __ARM_FP 0xE
Richard Barton3b82ed32013-11-22 11:53:28 +0000272
Silviu Barangae5690462013-10-21 10:59:33 +0000273// Test whether predefines are as expected when targeting cortex-a15.
James Y Knight3508b222016-04-01 21:33:20 +0000274// RUN: %clang -target armv7 -mcpu=cortex-a15 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A15 %s
275// 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 +0000276// A15:#define __ARM_ARCH_EXT_IDIV__ 1
James Y Knight3508b222016-04-01 21:33:20 +0000277// A15:#define __ARM_FEATURE_DSP 1
Artyom Skrobov59f43bb2016-03-23 13:32:33 +0000278// A15:#define __ARM_FP 0xE
Silviu Barangae5690462013-10-21 10:59:33 +0000279
Renato Golin5886bc32014-10-13 10:22:48 +0000280// Check that -mfpu works properly for Cortex-A17 (enabled by default).
James Y Knight3508b222016-04-01 21:33:20 +0000281// 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
282// 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
Richard Barton7dacc242015-10-21 10:03:55 +0000283// DEFAULTFPU-A17:#define __ARM_FP 0xE
Renato Golin5886bc32014-10-13 10:22:48 +0000284// DEFAULTFPU-A17:#define __ARM_NEON__ 1
285// DEFAULTFPU-A17:#define __ARM_VFPV4__ 1
286
James Y Knight3508b222016-04-01 21:33:20 +0000287// 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
288// 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 +0000289// FPUNONE-A17-NOT:#define __ARM_FP 0x{{.*}}
Renato Golin5886bc32014-10-13 10:22:48 +0000290// FPUNONE-A17-NOT:#define __ARM_NEON__ 1
291// FPUNONE-A17-NOT:#define __ARM_VFPV4__ 1
292
293// Test whether predefines are as expected when targeting cortex-a17.
James Y Knight3508b222016-04-01 21:33:20 +0000294// RUN: %clang -target armv7 -mcpu=cortex-a17 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A17 %s
295// 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 +0000296// A17:#define __ARM_ARCH 7
297// A17:#define __ARM_ARCH_7A__ 1
298// A17:#define __ARM_ARCH_EXT_IDIV__ 1
299// A17:#define __ARM_ARCH_PROFILE 'A'
James Y Knight3508b222016-04-01 21:33:20 +0000300// A17:#define __ARM_FEATURE_DSP 1
Richard Barton7dacc242015-10-21 10:03:55 +0000301// A17:#define __ARM_FP 0xE
Renato Golin5886bc32014-10-13 10:22:48 +0000302
Silviu Barangae5690462013-10-21 10:59:33 +0000303// Test whether predefines are as expected when targeting swift.
James Y Knight3508b222016-04-01 21:33:20 +0000304// RUN: %clang -target armv7s -mcpu=swift -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=SWIFT %s
305// 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 +0000306// SWIFT:#define __ARM_ARCH_EXT_IDIV__ 1
James Y Knight3508b222016-04-01 21:33:20 +0000307// SWIFT:#define __ARM_FEATURE_DSP 1
Artyom Skrobov59f43bb2016-03-23 13:32:33 +0000308// SWIFT:#define __ARM_FP 0xE
Silviu Barangae5690462013-10-21 10:59:33 +0000309
Renato Golin930de672016-03-21 17:29:51 +0000310// Test whether predefines are as expected when targeting ARMv8-A Cortex implementations
James Y Knight3508b222016-04-01 21:33:20 +0000311// RUN: %clang -target armv8 -mcpu=cortex-a32 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
312// 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 +0000313// RUN: %clang -target armv8 -mcpu=cortex-a35 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
314// 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 +0000315// RUN: %clang -target armv8 -mcpu=cortex-a53 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
316// 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 +0000317// RUN: %clang -target armv8 -mcpu=cortex-a57 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
318// RUN: %clang -target armv8 -mthumb -mcpu=cortex-a57 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
319// RUN: %clang -target armv8 -mcpu=cortex-a72 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
320// 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 +0000321// RUN: %clang -target armv8 -mcpu=cortex-a73 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
322// 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 +0000323// ARMV8:#define __ARM_ARCH_EXT_IDIV__ 1
James Y Knight3508b222016-04-01 21:33:20 +0000324// ARMV8:#define __ARM_FEATURE_DSP 1
Artyom Skrobov59f43bb2016-03-23 13:32:33 +0000325// ARMV8:#define __ARM_FP 0xE
Silviu Barangae5690462013-10-21 10:59:33 +0000326
Javed Absar879d18b82015-04-09 14:12:10 +0000327// Test whether predefines are as expected when targeting cortex-r4.
James Y Knight3508b222016-04-01 21:33:20 +0000328// 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 +0000329// R4-ARM-NOT:#define __ARM_ARCH_EXT_IDIV__
James Y Knight3508b222016-04-01 21:33:20 +0000330// R4-ARM:#define __ARM_FEATURE_DSP 1
Richard Barton7dacc242015-10-21 10:03:55 +0000331// R4-ARM-NOT:#define __ARM_FP 0x{{.*}}
Javed Absar879d18b82015-04-09 14:12:10 +0000332
James Y Knight3508b222016-04-01 21:33:20 +0000333// 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 +0000334// R4-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
James Y Knight3508b222016-04-01 21:33:20 +0000335// R4-THUMB:#define __ARM_FEATURE_DSP 1
Richard Barton7dacc242015-10-21 10:03:55 +0000336// R4-THUMB-NOT:#define __ARM_FP 0x{{.*}}
Javed Absar879d18b82015-04-09 14:12:10 +0000337
338// Test whether predefines are as expected when targeting cortex-r4f.
James Y Knight3508b222016-04-01 21:33:20 +0000339// 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 +0000340// R4F-ARM-NOT:#define __ARM_ARCH_EXT_IDIV__
James Y Knight3508b222016-04-01 21:33:20 +0000341// R4F-ARM:#define __ARM_FEATURE_DSP 1
Richard Barton7dacc242015-10-21 10:03:55 +0000342// R4F-ARM:#define __ARM_FP 0xC
Javed Absar879d18b82015-04-09 14:12:10 +0000343
James Y Knight3508b222016-04-01 21:33:20 +0000344// 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 +0000345// R4F-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
James Y Knight3508b222016-04-01 21:33:20 +0000346// R4F-THUMB:#define __ARM_FEATURE_DSP 1
Richard Barton7dacc242015-10-21 10:03:55 +0000347// R4F-THUMB:#define __ARM_FP 0xC
Javed Absar879d18b82015-04-09 14:12:10 +0000348
Silviu Barangae5690462013-10-21 10:59:33 +0000349// Test whether predefines are as expected when targeting cortex-r5.
James Y Knight3508b222016-04-01 21:33:20 +0000350// RUN: %clang -target armv7 -mcpu=cortex-r5 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R5 %s
351// 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 +0000352// R5:#define __ARM_ARCH_EXT_IDIV__ 1
James Y Knight3508b222016-04-01 21:33:20 +0000353// R5:#define __ARM_FEATURE_DSP 1
Artyom Skrobov59f43bb2016-03-23 13:32:33 +0000354// R5:#define __ARM_FP 0xC
Silviu Barangae5690462013-10-21 10:59:33 +0000355
Pablo Barrio2a35ff02016-03-16 10:21:04 +0000356// Test whether predefines are as expected when targeting cortex-r7 and cortex-r8.
James Y Knight3508b222016-04-01 21:33:20 +0000357// RUN: %clang -target armv7 -mcpu=cortex-r7 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R7-R8 %s
358// RUN: %clang -target armv7 -mthumb -mcpu=cortex-r7 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R7-R8 %s
359// RUN: %clang -target armv7 -mcpu=cortex-r8 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R7-R8 %s
360// 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 +0000361// R7-R8:#define __ARM_ARCH_EXT_IDIV__ 1
James Y Knight3508b222016-04-01 21:33:20 +0000362// R7-R8:#define __ARM_FEATURE_DSP 1
Artyom Skrobov59f43bb2016-03-23 13:32:33 +0000363// R7-R8:#define __ARM_FP 0xE
Bradley Smithd86d6702015-02-18 10:34:48 +0000364
Silviu Barangae5690462013-10-21 10:59:33 +0000365// Test whether predefines are as expected when targeting cortex-m0.
James Y Knight3508b222016-04-01 21:33:20 +0000366// RUN: %clang -target armv7 -mthumb -mcpu=cortex-m0 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M0-THUMB %s
367// RUN: %clang -target armv7 -mthumb -mcpu=cortex-m0plus -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M0-THUMB %s
368// RUN: %clang -target armv7 -mthumb -mcpu=cortex-m1 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M0-THUMB %s
369// 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 +0000370// M0-THUMB-NOT:#define __ARM_ARCH_EXT_IDIV__
Sergey Dmitrouk745f5302014-11-25 08:57:36 +0000371// M0-THUMB-NOT:#define __ARM_FEATURE_DSP
Richard Barton7dacc242015-10-21 10:03:55 +0000372// M0-THUMB-NOT:#define __ARM_FP 0x{{.*}}
Silviu Barangae5690462013-10-21 10:59:33 +0000373
374// Test whether predefines are as expected when targeting cortex-m3.
James Y Knight3508b222016-04-01 21:33:20 +0000375// RUN: %clang -target armv7 -mthumb -mcpu=cortex-m3 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M3-THUMB %s
376// 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 +0000377// M3-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
Sergey Dmitrouk745f5302014-11-25 08:57:36 +0000378// M3-THUMB-NOT:#define __ARM_FEATURE_DSP
Richard Barton7dacc242015-10-21 10:03:55 +0000379// M3-THUMB-NOT:#define __ARM_FP 0x{{.*}}
Silviu Barangae5690462013-10-21 10:59:33 +0000380
381// Test whether predefines are as expected when targeting cortex-m4.
James Y Knight3508b222016-04-01 21:33:20 +0000382// 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 +0000383// M4-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
James Y Knight3508b222016-04-01 21:33:20 +0000384// M4-THUMB:#define __ARM_FEATURE_DSP 1
Richard Barton7dacc242015-10-21 10:03:55 +0000385// M4-THUMB:#define __ARM_FP 0x6
Ana Pazosdd6068d2013-12-06 22:43:17 +0000386
Oliver Stannardbfd3ea32014-10-01 09:03:02 +0000387// Test whether predefines are as expected when targeting cortex-m7.
James Y Knight3508b222016-04-01 21:33:20 +0000388// 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 +0000389// M7-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
James Y Knight3508b222016-04-01 21:33:20 +0000390// M7-THUMB:#define __ARM_FEATURE_DSP 1
Richard Barton7dacc242015-10-21 10:03:55 +0000391// M7-THUMB:#define __ARM_FP 0xE
Tim Northoverc67803f2016-12-21 20:49:43 +0000392// M7-THUMB:#define __ARM_FPV5__ 1
Oliver Stannardbfd3ea32014-10-01 09:03:02 +0000393
Ana Pazosdd6068d2013-12-06 22:43:17 +0000394// Test whether predefines are as expected when targeting krait.
James Y Knight3508b222016-04-01 21:33:20 +0000395// RUN: %clang -target armv7 -mcpu=krait -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=KRAIT %s
396// 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 +0000397// KRAIT:#define __ARM_ARCH_EXT_IDIV__ 1
James Y Knight3508b222016-04-01 21:33:20 +0000398// KRAIT:#define __ARM_FEATURE_DSP 1
Artyom Skrobov59f43bb2016-03-23 13:32:33 +0000399// KRAIT:#define __ARM_VFPV4__ 1
Vladimir Sukharevc6dab752015-05-14 08:25:18 +0000400
James Y Knight3508b222016-04-01 21:33:20 +0000401// RUN: %clang -target armv8.1a-none-none-eabi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V81A %s
402// CHECK-V81A: #define __ARM_ARCH 8
403// CHECK-V81A: #define __ARM_ARCH_8_1A__ 1
Vladimir Sukharevc6dab752015-05-14 08:25:18 +0000404// CHECK-V81A: #define __ARM_ARCH_PROFILE 'A'
James Y Knight3508b222016-04-01 21:33:20 +0000405// CHECK-V81A: #define __ARM_FEATURE_QRDMX 1
Richard Barton7dacc242015-10-21 10:03:55 +0000406// CHECK-V81A: #define __ARM_FP 0xE
Oliver Stannard3086c042016-02-11 16:05:52 +0000407
James Y Knight3508b222016-04-01 21:33:20 +0000408// RUN: %clang -target armv8.2a-none-none-eabi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V82A %s
409// CHECK-V82A: #define __ARM_ARCH 8
410// CHECK-V82A: #define __ARM_ARCH_8_2A__ 1
Oliver Stannard3086c042016-02-11 16:05:52 +0000411// CHECK-V82A: #define __ARM_ARCH_PROFILE 'A'
412// CHECK-V82A: #define __ARM_FP 0xE