blob: 43c9c7c65ff58dceb4866fda5be1e3ea32fdf12a [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
Benjamin Kramer3a13ed62017-12-28 16:58:54 +00008// CHECK-V8A: #define __ARM_FP 0xe
James Y Knight3508b222016-04-01 21:33:20 +00009// 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
Benjamin Kramer3a13ed62017-12-28 16:58:54 +000019// CHECK-V8R: #define __ARM_FP 0xe
Javed Absar00b74442016-10-07 12:08:41 +000020
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
Benjamin Kramer3a13ed62017-12-28 16:58:54 +000028// CHECK-V7: #define __ARM_FP 0xc
Silviu Barangae5690462013-10-21 10:59:33 +000029
George Burgess IVfc970562017-02-09 23:30:10 +000030// RUN: %clang -target armv7ve-none-linux-gnu -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V7VE %s
31// CHECK-V7VE: #define __ARMEL__ 1
32// CHECK-V7VE: #define __ARM_ARCH 7
33// CHECK-V7VE: #define __ARM_ARCH_7VE__ 1
34// CHECK-V7VE: #define __ARM_ARCH_EXT_IDIV__ 1
Benjamin Kramer3a13ed62017-12-28 16:58:54 +000035// CHECK-V7VE: #define __ARM_FP 0xc
George Burgess IVfc970562017-02-09 23:30:10 +000036
James Y Knight3508b222016-04-01 21:33:20 +000037// 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
38// CHECK-V7S: #define __ARMEL__ 1
39// CHECK-V7S: #define __ARM_ARCH 7
40// CHECK-V7S: #define __ARM_ARCH_7S__ 1
Tim Northover525c73c2015-07-21 21:47:33 +000041// CHECK-V7S-NOT: __ARM_FEATURE_CRC32
42// CHECK-V7S-NOT: __ARM_FEATURE_NUMERIC_MAXMIN
43// CHECK-V7S-NOT: __ARM_FEATURE_DIRECTED_ROUNDING
Benjamin Kramer3a13ed62017-12-28 16:58:54 +000044// CHECK-V7S: #define __ARM_FP 0xe
Tim Northover525c73c2015-07-21 21:47:33 +000045
James Y Knight3508b222016-04-01 21:33:20 +000046// RUN: %clang -target armv8a -mfloat-abi=hard -x c -E -dM %s | FileCheck -match-full-lines --check-prefix=CHECK-V8-BAREHF %s
47// CHECK-V8-BAREHF: #define __ARMEL__ 1
48// CHECK-V8-BAREHF: #define __ARM_ARCH 8
49// CHECK-V8-BAREHF: #define __ARM_ARCH_8A__ 1
50// CHECK-V8-BAREHF: #define __ARM_FEATURE_CRC32 1
51// CHECK-V8-BAREHF: #define __ARM_FEATURE_DIRECTED_ROUNDING 1
52// CHECK-V8-BAREHF: #define __ARM_FEATURE_NUMERIC_MAXMIN 1
Benjamin Kramer3a13ed62017-12-28 16:58:54 +000053// CHECK-V8-BAREHP: #define __ARM_FP 0xe
James Y Knight3508b222016-04-01 21:33:20 +000054// CHECK-V8-BAREHF: #define __ARM_NEON__ 1
55// CHECK-V8-BAREHF: #define __ARM_PCS_VFP 1
56// CHECK-V8-BAREHF: #define __VFP_FP__ 1
Bernard Ogdenda13af32013-10-24 18:32:51 +000057
James Y Knight3508b222016-04-01 21:33:20 +000058// 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 +000059// CHECK-V8-BAREHF-FP-NOT: __ARM_NEON__ 1
Benjamin Kramer3a13ed62017-12-28 16:58:54 +000060// CHECK-V8-BAREHP-FP: #define __ARM_FP 0xe
James Y Knight3508b222016-04-01 21:33:20 +000061// CHECK-V8-BAREHF-FP: #define __VFP_FP__ 1
Bernard Ogdenda13af32013-10-24 18:32:51 +000062
James Y Knight3508b222016-04-01 21:33:20 +000063// 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
64// 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 +000065// CHECK-V8-BAREHP-NEON-FP: #define __ARM_FP 0xe
James Y Knight3508b222016-04-01 21:33:20 +000066// CHECK-V8-BAREHF-NEON-FP: #define __ARM_NEON__ 1
67// CHECK-V8-BAREHF-NEON-FP: #define __VFP_FP__ 1
Bernard Ogdenda13af32013-10-24 18:32:51 +000068
James Y Knight3508b222016-04-01 21:33:20 +000069// 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 +000070// CHECK-V8-NOCRC-NOT: __ARM_FEATURE_CRC32 1
71
Silviu Barangae5690462013-10-21 10:59:33 +000072// Check that -mhwdiv works properly for armv8/thumbv8 (enabled by default).
73
James Y Knight3508b222016-04-01 21:33:20 +000074// RUN: %clang -target armv8 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8 %s
75// RUN: %clang -target armv8 -mthumb -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8 %s
76// RUN: %clang -target armv8-eabi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8 %s
77// 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 +000078// V8:#define __ARM_ARCH_EXT_IDIV__ 1
Silviu Barangae5690462013-10-21 10:59:33 +000079
James Y Knight3508b222016-04-01 21:33:20 +000080// RUN: %clang -target armv8 -mhwdiv=none -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NOHWDIV-V8 %s
81// RUN: %clang -target armv8 -mthumb -mhwdiv=none -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NOHWDIV-V8 %s
82// RUN: %clang -target armv8 -mhwdiv=thumb -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NOHWDIV-V8 %s
83// 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 +000084// NOHWDIV-V8-NOT:#define __ARM_ARCH_EXT_IDIV__
Silviu Barangae5690462013-10-21 10:59:33 +000085
James Y Knight3508b222016-04-01 21:33:20 +000086// RUN: %clang -target armv8a -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8A %s
87// RUN: %clang -target armv8a -mthumb -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8A %s
Keith Walkerc5bbd112017-11-30 12:05:18 +000088// RUN: %clang -target armv8a-eabi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8A %s
89// 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 +000090// V8A:#define __ARM_ARCH_EXT_IDIV__ 1
Benjamin Kramer3a13ed62017-12-28 16:58:54 +000091// V8A:#define __ARM_FP 0xe
Silviu Barangae5690462013-10-21 10:59:33 +000092
James Y Knight3508b222016-04-01 21:33:20 +000093// RUN: %clang -target armv8m.base-none-linux-gnu -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8M_BASELINE %s
94// V8M_BASELINE: #define __ARM_ARCH 8
95// V8M_BASELINE: #define __ARM_ARCH_8M_BASE__ 1
96// V8M_BASELINE: #define __ARM_ARCH_EXT_IDIV__ 1
Bradley Smithf4affc12016-03-03 13:52:22 +000097// V8M_BASELINE-NOT: __ARM_ARCH_ISA_ARM
James Y Knight3508b222016-04-01 21:33:20 +000098// V8M_BASELINE: #define __ARM_ARCH_ISA_THUMB 1
99// V8M_BASELINE: #define __ARM_ARCH_PROFILE 'M'
Bradley Smithf4affc12016-03-03 13:52:22 +0000100// V8M_BASELINE-NOT: __ARM_FEATURE_CRC32
101// V8M_BASELINE-NOT: __ARM_FEATURE_DSP
102// V8M_BASELINE-NOT: __ARM_FP 0x{{.*}}
103// V8M_BASELINE-NOT: __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1
104
James Y Knight3508b222016-04-01 21:33:20 +0000105// RUN: %clang -target armv8m.main-none-linux-gnu -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8M_MAINLINE %s
106// V8M_MAINLINE: #define __ARM_ARCH 8
107// V8M_MAINLINE: #define __ARM_ARCH_8M_MAIN__ 1
108// V8M_MAINLINE: #define __ARM_ARCH_EXT_IDIV__ 1
Bradley Smithf4affc12016-03-03 13:52:22 +0000109// V8M_MAINLINE-NOT: __ARM_ARCH_ISA_ARM
James Y Knight3508b222016-04-01 21:33:20 +0000110// V8M_MAINLINE: #define __ARM_ARCH_ISA_THUMB 2
111// V8M_MAINLINE: #define __ARM_ARCH_PROFILE 'M'
Bradley Smithf4affc12016-03-03 13:52:22 +0000112// V8M_MAINLINE-NOT: __ARM_FEATURE_CRC32
113// V8M_MAINLINE-NOT: __ARM_FEATURE_DSP
Benjamin Kramer3a13ed62017-12-28 16:58:54 +0000114// V8M_MAINLINE: #define __ARM_FP 0xe
James Y Knight3508b222016-04-01 21:33:20 +0000115// V8M_MAINLINE: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
Bradley Smithf4affc12016-03-03 13:52:22 +0000116
James Y Knight3508b222016-04-01 21:33:20 +0000117// 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
118// V8M_MAINLINE_DSP: #define __ARM_ARCH 8
119// V8M_MAINLINE_DSP: #define __ARM_ARCH_8M_MAIN__ 1
120// V8M_MAINLINE_DSP: #define __ARM_ARCH_EXT_IDIV__ 1
Bradley Smithf4affc12016-03-03 13:52:22 +0000121// V8M_MAINLINE_DSP-NOT: __ARM_ARCH_ISA_ARM
James Y Knight3508b222016-04-01 21:33:20 +0000122// V8M_MAINLINE_DSP: #define __ARM_ARCH_ISA_THUMB 2
123// V8M_MAINLINE_DSP: #define __ARM_ARCH_PROFILE 'M'
Bradley Smithf4affc12016-03-03 13:52:22 +0000124// V8M_MAINLINE_DSP-NOT: __ARM_FEATURE_CRC32
James Y Knight3508b222016-04-01 21:33:20 +0000125// V8M_MAINLINE_DSP: #define __ARM_FEATURE_DSP 1
Benjamin Kramer3a13ed62017-12-28 16:58:54 +0000126// V8M_MAINLINE_DSP: #define __ARM_FP 0xe
James Y Knight3508b222016-04-01 21:33:20 +0000127// V8M_MAINLINE_DSP: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
Bradley Smithf4affc12016-03-03 13:52:22 +0000128
James Y Knight3508b222016-04-01 21:33:20 +0000129// 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 +0000130// CHECK-DEFS:#define __ARM_PCS 1
Bradley Smith0f28f0c2014-01-20 10:52:00 +0000131// CHECK-DEFS:#define __ARM_SIZEOF_MINIMAL_ENUM 4
132// CHECK-DEFS:#define __ARM_SIZEOF_WCHAR_T 4
133
Alexandros Lamprineasf5a8e6c2015-10-02 14:56:37 +0000134// RUN: %clang -target arm-none-linux-gnu -fno-math-errno -fno-signed-zeros\
135// RUN: -fno-trapping-math -fassociative-math -freciprocal-math\
James Y Knight3508b222016-04-01 21:33:20 +0000136// RUN: -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FASTMATH %s
Alexandros Lamprineasf5a8e6c2015-10-02 14:56:37 +0000137// RUN: %clang -target arm-none-linux-gnu -ffast-math -x c -E -dM %s -o -\
James Y Knight3508b222016-04-01 21:33:20 +0000138// RUN: | FileCheck -match-full-lines --check-prefix=CHECK-FASTMATH %s
139// CHECK-FASTMATH: #define __ARM_FP_FAST 1
Alexandros Lamprineasf5a8e6c2015-10-02 14:56:37 +0000140
James Y Knight3508b222016-04-01 21:33:20 +0000141// 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 +0000142// CHECK-SHORTWCHAR:#define __ARM_SIZEOF_WCHAR_T 2
143
James Y Knight3508b222016-04-01 21:33:20 +0000144// 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 +0000145// CHECK-SHORTENUMS:#define __ARM_SIZEOF_MINIMAL_ENUM 1
Silviu Barangae5690462013-10-21 10:59:33 +0000146
147// 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 +0000148// RUN: %clang -target armv7 -mcpu=cortex-a15 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=HWDIV %s
149// RUN: %clang -target armv7 -mthumb -mcpu=cortex-a15 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=HWDIV %s
150// RUN: %clang -target armv7 -mcpu=cortex-a15 -mhwdiv=arm -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=HWDIV %s
151// 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 +0000152// HWDIV:#define __ARM_ARCH_EXT_IDIV__ 1
Silviu Barangae5690462013-10-21 10:59:33 +0000153
James Y Knight3508b222016-04-01 21:33:20 +0000154// RUN: %clang -target arm -mcpu=cortex-a15 -mhwdiv=thumb -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NOHWDIV %s
155// RUN: %clang -target arm -mthumb -mcpu=cortex-a15 -mhwdiv=arm -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NOHWDIV %s
156// RUN: %clang -target arm -mcpu=cortex-a15 -mhwdiv=none -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NOHWDIV %s
157// 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 +0000158// NOHWDIV-NOT:#define __ARM_ARCH_EXT_IDIV__
Silviu Barangae5690462013-10-21 10:59:33 +0000159
Artyom Skrobov53b000a82013-11-21 14:04:38 +0000160
161// Check that -mfpu works properly for Cortex-A7 (enabled by default).
James Y Knight3508b222016-04-01 21:33:20 +0000162// 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
163// 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
Benjamin Kramer3a13ed62017-12-28 16:58:54 +0000164// DEFAULTFPU-A7:#define __ARM_FP 0xe
Artyom Skrobov53b000a82013-11-21 14:04:38 +0000165// DEFAULTFPU-A7:#define __ARM_NEON__ 1
166// DEFAULTFPU-A7:#define __ARM_VFPV4__ 1
167
James Y Knight3508b222016-04-01 21:33:20 +0000168// 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
169// 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 +0000170// FPUNONE-A7-NOT:#define __ARM_FP 0x{{.*}}
Artyom Skrobov53b000a82013-11-21 14:04:38 +0000171// FPUNONE-A7-NOT:#define __ARM_NEON__ 1
172// FPUNONE-A7-NOT:#define __ARM_VFPV4__ 1
173
James Y Knight3508b222016-04-01 21:33:20 +0000174// 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
175// 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 +0000176// NONEON-A7:#define __ARM_FP 0xe
Artyom Skrobov53b000a82013-11-21 14:04:38 +0000177// NONEON-A7-NOT:#define __ARM_NEON__ 1
178// NONEON-A7:#define __ARM_VFPV4__ 1
179
Amara Emersona1daec72013-11-25 13:18:59 +0000180// Check that -mfpu works properly for Cortex-A5 (enabled by default).
James Y Knight3508b222016-04-01 21:33:20 +0000181// 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
182// 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 +0000183// DEFAULTFPU-A5:#define __ARM_FP 0xe
Amara Emersona1daec72013-11-25 13:18:59 +0000184// DEFAULTFPU-A5:#define __ARM_NEON__ 1
185// DEFAULTFPU-A5:#define __ARM_VFPV4__ 1
186
James Y Knight3508b222016-04-01 21:33:20 +0000187// 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
188// 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 +0000189// FPUNONE-A5-NOT:#define __ARM_FP 0x{{.*}}
Amara Emersona1daec72013-11-25 13:18:59 +0000190// FPUNONE-A5-NOT:#define __ARM_NEON__ 1
191// FPUNONE-A5-NOT:#define __ARM_VFPV4__ 1
192
James Y Knight3508b222016-04-01 21:33:20 +0000193// 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
194// 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 +0000195// NONEON-A5:#define __ARM_FP 0xe
Amara Emersona1daec72013-11-25 13:18:59 +0000196// NONEON-A5-NOT:#define __ARM_NEON__ 1
197// NONEON-A5:#define __ARM_VFPV4__ 1
198
Silviu Barangae5690462013-10-21 10:59:33 +0000199// FIXME: add check for further predefines
Sergey Dmitrouk745f5302014-11-25 08:57:36 +0000200// Test whether predefines are as expected when targeting ep9312.
James Y Knight3508b222016-04-01 21:33:20 +0000201// 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 +0000202// A4T-NOT:#define __ARM_FEATURE_DSP
Richard Barton7dacc242015-10-21 10:03:55 +0000203// A4T-NOT:#define __ARM_FP 0x{{.*}}
Sergey Dmitrouk745f5302014-11-25 08:57:36 +0000204
205// Test whether predefines are as expected when targeting arm10tdmi.
James Y Knight3508b222016-04-01 21:33:20 +0000206// 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 +0000207// A5T-NOT:#define __ARM_FEATURE_DSP
Richard Barton7dacc242015-10-21 10:03:55 +0000208// A5T-NOT:#define __ARM_FP 0x{{.*}}
Sergey Dmitrouk745f5302014-11-25 08:57:36 +0000209
Keith Walkerc5bbd112017-11-30 12:05:18 +0000210// Test whether predefines are as expected when targeting cortex-a5.
James Y Knight3508b222016-04-01 21:33:20 +0000211// RUN: %clang -target armv7 -mcpu=cortex-a5 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A5 %s
212// 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 +0000213// A5:#define __ARM_ARCH 7
214// A5:#define __ARM_ARCH_7A__ 1
Artyom Skrobov59f43bb2016-03-23 13:32:33 +0000215// A5-NOT:#define __ARM_ARCH_EXT_IDIV__
Saleem Abdulrasool52a5d412014-06-15 18:48:41 +0000216// A5:#define __ARM_ARCH_PROFILE 'A'
Martell Malonec950c652017-11-29 07:25:12 +0000217// A5-NOT:#define __ARM_DWARF_EH__ 1
James Molloy0ffb0932014-09-15 11:25:38 +0000218// A5-NOT: #define __ARM_FEATURE_DIRECTED_ROUNDING
James Y Knight3508b222016-04-01 21:33:20 +0000219// A5:#define __ARM_FEATURE_DSP 1
Artyom Skrobov59f43bb2016-03-23 13:32:33 +0000220// A5-NOT: #define __ARM_FEATURE_NUMERIC_MAXMIN
Benjamin Kramer3a13ed62017-12-28 16:58:54 +0000221// A5:#define __ARM_FP 0xe
Amara Emersona1daec72013-11-25 13:18:59 +0000222
Keith Walkerc5bbd112017-11-30 12:05:18 +0000223// Test whether predefines are as expected when targeting cortex-a7.
James Y Knight3508b222016-04-01 21:33:20 +0000224// RUN: %clang -target armv7k -mcpu=cortex-a7 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A7 %s
225// 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 +0000226// A7:#define __ARM_ARCH 7
Artyom Skrobov53b000a82013-11-21 14:04:38 +0000227// A7:#define __ARM_ARCH_EXT_IDIV__ 1
Saleem Abdulrasool52a5d412014-06-15 18:48:41 +0000228// A7:#define __ARM_ARCH_PROFILE 'A'
Martell Malonec950c652017-11-29 07:25:12 +0000229// A7-NOT:#define __ARM_DWARF_EH__ 1
James Y Knight3508b222016-04-01 21:33:20 +0000230// A7:#define __ARM_FEATURE_DSP 1
Benjamin Kramer3a13ed62017-12-28 16:58:54 +0000231// A7:#define __ARM_FP 0xe
Artyom Skrobov53b000a82013-11-21 14:04:38 +0000232
Tim Northover32617992016-04-28 14:01:49 +0000233// Test whether predefines are as expected when targeting cortex-a7.
234// RUN: %clang -target x86_64-apple-darwin -arch armv7k -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV7K %s
235// ARMV7K:#define __ARM_ARCH 7
236// ARMV7K:#define __ARM_ARCH_EXT_IDIV__ 1
237// ARMV7K:#define __ARM_ARCH_PROFILE 'A'
Chris Bieneman46977b62016-04-29 17:53:00 +0000238// ARMV7K:#define __ARM_DWARF_EH__ 1
Tim Northover32617992016-04-28 14:01:49 +0000239// ARMV7K:#define __ARM_FEATURE_DSP 1
Benjamin Kramer3a13ed62017-12-28 16:58:54 +0000240// ARMV7K:#define __ARM_FP 0xe
Tim Northover32617992016-04-28 14:01:49 +0000241// ARMV7K:#define __ARM_PCS_VFP 1
242
243
Keith Walkerc5bbd112017-11-30 12:05:18 +0000244// Test whether predefines are as expected when targeting cortex-a8.
James Y Knight3508b222016-04-01 21:33:20 +0000245// RUN: %clang -target armv7 -mcpu=cortex-a8 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A8 %s
246// 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 +0000247// A8-NOT:#define __ARM_ARCH_EXT_IDIV__
James Y Knight3508b222016-04-01 21:33:20 +0000248// A8:#define __ARM_FEATURE_DSP 1
Benjamin Kramer3a13ed62017-12-28 16:58:54 +0000249// A8:#define __ARM_FP 0xc
Silviu Barangae5690462013-10-21 10:59:33 +0000250
Keith Walkerc5bbd112017-11-30 12:05:18 +0000251// Test whether predefines are as expected when targeting cortex-a9.
James Y Knight3508b222016-04-01 21:33:20 +0000252// RUN: %clang -target armv7 -mcpu=cortex-a9 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A9 %s
253// 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 +0000254// A9-NOT:#define __ARM_ARCH_EXT_IDIV__
James Y Knight3508b222016-04-01 21:33:20 +0000255// A9:#define __ARM_FEATURE_DSP 1
Benjamin Kramer3a13ed62017-12-28 16:58:54 +0000256// A9:#define __ARM_FP 0xe
Silviu Barangae5690462013-10-21 10:59:33 +0000257
Richard Barton3b82ed32013-11-22 11:53:28 +0000258
259// Check that -mfpu works properly for Cortex-A12 (enabled by default).
James Y Knight3508b222016-04-01 21:33:20 +0000260// 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
261// 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 +0000262// DEFAULTFPU-A12:#define __ARM_FP 0xe
Richard Barton3b82ed32013-11-22 11:53:28 +0000263// DEFAULTFPU-A12:#define __ARM_NEON__ 1
264// DEFAULTFPU-A12:#define __ARM_VFPV4__ 1
265
James Y Knight3508b222016-04-01 21:33:20 +0000266// 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
267// 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 +0000268// FPUNONE-A12-NOT:#define __ARM_FP 0x{{.*}}
Richard Barton3b82ed32013-11-22 11:53:28 +0000269// FPUNONE-A12-NOT:#define __ARM_NEON__ 1
270// FPUNONE-A12-NOT:#define __ARM_VFPV4__ 1
271
Keith Walkerc5bbd112017-11-30 12:05:18 +0000272// Test whether predefines are as expected when targeting cortex-a12.
James Y Knight3508b222016-04-01 21:33:20 +0000273// RUN: %clang -target armv7 -mcpu=cortex-a12 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A12 %s
274// 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 +0000275// A12:#define __ARM_ARCH 7
276// A12:#define __ARM_ARCH_7A__ 1
277// A12:#define __ARM_ARCH_EXT_IDIV__ 1
Saleem Abdulrasool52a5d412014-06-15 18:48:41 +0000278// A12:#define __ARM_ARCH_PROFILE 'A'
James Y Knight3508b222016-04-01 21:33:20 +0000279// A12:#define __ARM_FEATURE_DSP 1
Benjamin Kramer3a13ed62017-12-28 16:58:54 +0000280// A12:#define __ARM_FP 0xe
Richard Barton3b82ed32013-11-22 11:53:28 +0000281
Keith Walkerc5bbd112017-11-30 12:05:18 +0000282// Test whether predefines are as expected when targeting cortex-a15.
James Y Knight3508b222016-04-01 21:33:20 +0000283// RUN: %clang -target armv7 -mcpu=cortex-a15 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A15 %s
284// 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 +0000285// A15:#define __ARM_ARCH_EXT_IDIV__ 1
James Y Knight3508b222016-04-01 21:33:20 +0000286// A15:#define __ARM_FEATURE_DSP 1
Benjamin Kramer3a13ed62017-12-28 16:58:54 +0000287// A15:#define __ARM_FP 0xe
Silviu Barangae5690462013-10-21 10:59:33 +0000288
Renato Golin5886bc32014-10-13 10:22:48 +0000289// Check that -mfpu works properly for Cortex-A17 (enabled by default).
James Y Knight3508b222016-04-01 21:33:20 +0000290// 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
291// 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 +0000292// DEFAULTFPU-A17:#define __ARM_FP 0xe
Renato Golin5886bc32014-10-13 10:22:48 +0000293// DEFAULTFPU-A17:#define __ARM_NEON__ 1
294// DEFAULTFPU-A17:#define __ARM_VFPV4__ 1
295
James Y Knight3508b222016-04-01 21:33:20 +0000296// 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
297// 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 +0000298// FPUNONE-A17-NOT:#define __ARM_FP 0x{{.*}}
Renato Golin5886bc32014-10-13 10:22:48 +0000299// FPUNONE-A17-NOT:#define __ARM_NEON__ 1
300// FPUNONE-A17-NOT:#define __ARM_VFPV4__ 1
301
Keith Walkerc5bbd112017-11-30 12:05:18 +0000302// Test whether predefines are as expected when targeting cortex-a17.
James Y Knight3508b222016-04-01 21:33:20 +0000303// RUN: %clang -target armv7 -mcpu=cortex-a17 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A17 %s
304// 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 +0000305// A17:#define __ARM_ARCH 7
306// A17:#define __ARM_ARCH_7A__ 1
307// A17:#define __ARM_ARCH_EXT_IDIV__ 1
308// A17:#define __ARM_ARCH_PROFILE 'A'
James Y Knight3508b222016-04-01 21:33:20 +0000309// A17:#define __ARM_FEATURE_DSP 1
Benjamin Kramer3a13ed62017-12-28 16:58:54 +0000310// A17:#define __ARM_FP 0xe
Renato Golin5886bc32014-10-13 10:22:48 +0000311
Keith Walkerc5bbd112017-11-30 12:05:18 +0000312// Test whether predefines are as expected when targeting swift.
James Y Knight3508b222016-04-01 21:33:20 +0000313// RUN: %clang -target armv7s -mcpu=swift -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=SWIFT %s
314// 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 +0000315// SWIFT:#define __ARM_ARCH_EXT_IDIV__ 1
James Y Knight3508b222016-04-01 21:33:20 +0000316// SWIFT:#define __ARM_FEATURE_DSP 1
Benjamin Kramer3a13ed62017-12-28 16:58:54 +0000317// SWIFT:#define __ARM_FP 0xe
Silviu Barangae5690462013-10-21 10:59:33 +0000318
Keith Walkerc5bbd112017-11-30 12:05:18 +0000319// Test whether predefines are as expected when targeting ARMv8-A Cortex implementations
James Y Knight3508b222016-04-01 21:33:20 +0000320// RUN: %clang -target armv8 -mcpu=cortex-a32 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
321// 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 +0000322// RUN: %clang -target armv8 -mcpu=cortex-a35 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
323// 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 +0000324// RUN: %clang -target armv8 -mcpu=cortex-a53 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
325// 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 +0000326// RUN: %clang -target armv8 -mcpu=cortex-a57 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
327// RUN: %clang -target armv8 -mthumb -mcpu=cortex-a57 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
328// RUN: %clang -target armv8 -mcpu=cortex-a72 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
329// 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 +0000330// RUN: %clang -target armv8 -mcpu=cortex-a73 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
331// 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 +0000332// ARMV8:#define __ARM_ARCH_EXT_IDIV__ 1
James Y Knight3508b222016-04-01 21:33:20 +0000333// ARMV8:#define __ARM_FEATURE_DSP 1
Benjamin Kramer3a13ed62017-12-28 16:58:54 +0000334// ARMV8:#define __ARM_FP 0xe
Silviu Barangae5690462013-10-21 10:59:33 +0000335
Javed Absar879d18b82015-04-09 14:12:10 +0000336// Test whether predefines are as expected when targeting cortex-r4.
James Y Knight3508b222016-04-01 21:33:20 +0000337// 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 +0000338// R4-ARM-NOT:#define __ARM_ARCH_EXT_IDIV__
James Y Knight3508b222016-04-01 21:33:20 +0000339// R4-ARM:#define __ARM_FEATURE_DSP 1
Richard Barton7dacc242015-10-21 10:03:55 +0000340// R4-ARM-NOT:#define __ARM_FP 0x{{.*}}
Javed Absar879d18b82015-04-09 14:12:10 +0000341
James Y Knight3508b222016-04-01 21:33:20 +0000342// 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 +0000343// R4-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
James Y Knight3508b222016-04-01 21:33:20 +0000344// R4-THUMB:#define __ARM_FEATURE_DSP 1
Richard Barton7dacc242015-10-21 10:03:55 +0000345// R4-THUMB-NOT:#define __ARM_FP 0x{{.*}}
Javed Absar879d18b82015-04-09 14:12:10 +0000346
Keith Walkerc5bbd112017-11-30 12:05:18 +0000347// Test whether predefines are as expected when targeting cortex-r4f.
James Y Knight3508b222016-04-01 21:33:20 +0000348// 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 +0000349// R4F-ARM-NOT:#define __ARM_ARCH_EXT_IDIV__
James Y Knight3508b222016-04-01 21:33:20 +0000350// R4F-ARM:#define __ARM_FEATURE_DSP 1
Benjamin Kramer3a13ed62017-12-28 16:58:54 +0000351// R4F-ARM:#define __ARM_FP 0xc
Javed Absar879d18b82015-04-09 14:12:10 +0000352
James Y Knight3508b222016-04-01 21:33:20 +0000353// 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 +0000354// R4F-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
James Y Knight3508b222016-04-01 21:33:20 +0000355// R4F-THUMB:#define __ARM_FEATURE_DSP 1
Benjamin Kramer3a13ed62017-12-28 16:58:54 +0000356// R4F-THUMB:#define __ARM_FP 0xc
Javed Absar879d18b82015-04-09 14:12:10 +0000357
Keith Walkerc5bbd112017-11-30 12:05:18 +0000358// Test whether predefines are as expected when targeting cortex-r5.
James Y Knight3508b222016-04-01 21:33:20 +0000359// RUN: %clang -target armv7 -mcpu=cortex-r5 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R5 %s
360// 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 +0000361// R5:#define __ARM_ARCH_EXT_IDIV__ 1
James Y Knight3508b222016-04-01 21:33:20 +0000362// R5:#define __ARM_FEATURE_DSP 1
Benjamin Kramer3a13ed62017-12-28 16:58:54 +0000363// R5:#define __ARM_FP 0xc
Silviu Barangae5690462013-10-21 10:59:33 +0000364
Keith Walkerc5bbd112017-11-30 12:05:18 +0000365// Test whether predefines are as expected when targeting cortex-r7 and cortex-r8.
James Y Knight3508b222016-04-01 21:33:20 +0000366// RUN: %clang -target armv7 -mcpu=cortex-r7 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R7-R8 %s
367// RUN: %clang -target armv7 -mthumb -mcpu=cortex-r7 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R7-R8 %s
368// RUN: %clang -target armv7 -mcpu=cortex-r8 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R7-R8 %s
369// 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 +0000370// R7-R8:#define __ARM_ARCH_EXT_IDIV__ 1
James Y Knight3508b222016-04-01 21:33:20 +0000371// R7-R8:#define __ARM_FEATURE_DSP 1
Benjamin Kramer3a13ed62017-12-28 16:58:54 +0000372// R7-R8:#define __ARM_FP 0xe
Bradley Smithd86d6702015-02-18 10:34:48 +0000373
Silviu Barangae5690462013-10-21 10:59:33 +0000374// Test whether predefines are as expected when targeting cortex-m0.
James Y Knight3508b222016-04-01 21:33:20 +0000375// RUN: %clang -target armv7 -mthumb -mcpu=cortex-m0 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M0-THUMB %s
376// RUN: %clang -target armv7 -mthumb -mcpu=cortex-m0plus -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M0-THUMB %s
377// RUN: %clang -target armv7 -mthumb -mcpu=cortex-m1 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M0-THUMB %s
378// 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 +0000379// M0-THUMB-NOT:#define __ARM_ARCH_EXT_IDIV__
Sergey Dmitrouk745f5302014-11-25 08:57:36 +0000380// M0-THUMB-NOT:#define __ARM_FEATURE_DSP
Richard Barton7dacc242015-10-21 10:03:55 +0000381// M0-THUMB-NOT:#define __ARM_FP 0x{{.*}}
Silviu Barangae5690462013-10-21 10:59:33 +0000382
383// Test whether predefines are as expected when targeting cortex-m3.
James Y Knight3508b222016-04-01 21:33:20 +0000384// RUN: %clang -target armv7 -mthumb -mcpu=cortex-m3 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M3-THUMB %s
385// 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 +0000386// M3-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
Sergey Dmitrouk745f5302014-11-25 08:57:36 +0000387// M3-THUMB-NOT:#define __ARM_FEATURE_DSP
Richard Barton7dacc242015-10-21 10:03:55 +0000388// M3-THUMB-NOT:#define __ARM_FP 0x{{.*}}
Silviu Barangae5690462013-10-21 10:59:33 +0000389
Keith Walkerc5bbd112017-11-30 12:05:18 +0000390// Test whether predefines are as expected when targeting cortex-m4.
James Y Knight3508b222016-04-01 21:33:20 +0000391// 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 +0000392// M4-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
James Y Knight3508b222016-04-01 21:33:20 +0000393// M4-THUMB:#define __ARM_FEATURE_DSP 1
Keith Walkerc5bbd112017-11-30 12:05:18 +0000394// M4-THUMB:#define __ARM_FP 0x6
Ana Pazosdd6068d2013-12-06 22:43:17 +0000395
Keith Walkerc5bbd112017-11-30 12:05:18 +0000396// Test whether predefines are as expected when targeting cortex-m7.
James Y Knight3508b222016-04-01 21:33:20 +0000397// 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 +0000398// M7-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
James Y Knight3508b222016-04-01 21:33:20 +0000399// M7-THUMB:#define __ARM_FEATURE_DSP 1
Benjamin Kramer3a13ed62017-12-28 16:58:54 +0000400// M7-THUMB:#define __ARM_FP 0xe
Keith Walkerc5bbd112017-11-30 12:05:18 +0000401// M7-THUMB:#define __ARM_FPV5__ 1
Oliver Stannardbfd3ea32014-10-01 09:03:02 +0000402
Sanne Wouda0479e692017-02-20 10:37:01 +0000403// Test whether predefines are as expected when targeting v8m cores
404// RUN: %clang -target arm -mcpu=cortex-m23 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M23 %s
405// M23: #define __ARM_ARCH 8
406// M23: #define __ARM_ARCH_8M_BASE__ 1
407// M23: #define __ARM_ARCH_EXT_IDIV__ 1
408// M23-NOT: __ARM_ARCH_ISA_ARM
409// M23: #define __ARM_ARCH_ISA_THUMB 1
410// M23: #define __ARM_ARCH_PROFILE 'M'
411// M23-NOT: __ARM_FEATURE_CRC32
412// M23-NOT: __ARM_FEATURE_DSP
413// M23-NOT: __ARM_FP 0x{{.*}}
414// M23-NOT: __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1
415
416// RUN: %clang -target arm -mcpu=cortex-m33 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M33 %s
417// M33: #define __ARM_ARCH 8
418// M33: #define __ARM_ARCH_8M_MAIN__ 1
419// M33: #define __ARM_ARCH_EXT_IDIV__ 1
420// M33-NOT: __ARM_ARCH_ISA_ARM
421// M33: #define __ARM_ARCH_ISA_THUMB 2
422// M33: #define __ARM_ARCH_PROFILE 'M'
423// M33-NOT: __ARM_FEATURE_CRC32
424// M33: #define __ARM_FEATURE_DSP 1
Keith Walkerc5bbd112017-11-30 12:05:18 +0000425// M33: #define __ARM_FP 0x6
Sanne Wouda0479e692017-02-20 10:37:01 +0000426// M33: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
427
Keith Walkerc5bbd112017-11-30 12:05:18 +0000428// Test whether predefines are as expected when targeting krait.
James Y Knight3508b222016-04-01 21:33:20 +0000429// RUN: %clang -target armv7 -mcpu=krait -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=KRAIT %s
430// 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 +0000431// KRAIT:#define __ARM_ARCH_EXT_IDIV__ 1
James Y Knight3508b222016-04-01 21:33:20 +0000432// KRAIT:#define __ARM_FEATURE_DSP 1
Keith Walkerc5bbd112017-11-30 12:05:18 +0000433// KRAIT:#define __ARM_VFPV4__ 1
Vladimir Sukharevc6dab752015-05-14 08:25:18 +0000434
James Y Knight3508b222016-04-01 21:33:20 +0000435// RUN: %clang -target armv8.1a-none-none-eabi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V81A %s
436// CHECK-V81A: #define __ARM_ARCH 8
437// CHECK-V81A: #define __ARM_ARCH_8_1A__ 1
Vladimir Sukharevc6dab752015-05-14 08:25:18 +0000438// CHECK-V81A: #define __ARM_ARCH_PROFILE 'A'
James Y Knight3508b222016-04-01 21:33:20 +0000439// CHECK-V81A: #define __ARM_FEATURE_QRDMX 1
Benjamin Kramer3a13ed62017-12-28 16:58:54 +0000440// CHECK-V81A: #define __ARM_FP 0xe
Oliver Stannard3086c042016-02-11 16:05:52 +0000441
James Y Knight3508b222016-04-01 21:33:20 +0000442// RUN: %clang -target armv8.2a-none-none-eabi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V82A %s
443// CHECK-V82A: #define __ARM_ARCH 8
444// CHECK-V82A: #define __ARM_ARCH_8_2A__ 1
Oliver Stannard3086c042016-02-11 16:05:52 +0000445// CHECK-V82A: #define __ARM_ARCH_PROFILE 'A'
Sjoerd Meijercb75f612017-06-30 08:07:34 +0000446// CHECK-V82A: #define __ARM_FEATURE_QRDMX 1
Benjamin Kramer3a13ed62017-12-28 16:58:54 +0000447// CHECK-V82A: #define __ARM_FP 0xe