James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 1 | // 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 Walker | 167961f | 2018-02-19 12:40:26 +0000 | [diff] [blame] | 8 | // CHECK-V8A-NOT: #define __ARM_FP 0x |
Oliver Stannard | 39ee9de | 2018-04-27 13:56:02 +0000 | [diff] [blame^] | 9 | // CHECK-V8A-NOT: #define __ARM_FEATURE_DOTPROD |
Keith Walker | 167961f | 2018-02-19 12:40:26 +0000 | [diff] [blame] | 10 | |
| 11 | // RUN: %clang -target armv8a-none-linux-gnueabi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V8A-ALLOW-FP-INSTR %s |
| 12 | // RUN: %clang -target armv8a-none-linux-gnueabihf -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V8A-ALLOW-FP-INSTR %s |
| 13 | // CHECK-V8A-ALLOW-FP-INSTR: #define __ARMEL__ 1 |
| 14 | // CHECK-V8A-ALLOW-FP-INSTR: #define __ARM_ARCH 8 |
| 15 | // CHECK-V8A-ALLOW-FP-INSTR: #define __ARM_ARCH_8A__ 1 |
| 16 | // CHECK-V8A-ALLOW-FP-INSTR: #define __ARM_FEATURE_CRC32 1 |
| 17 | // CHECK-V8A-ALLOW-FP-INSTR: #define __ARM_FEATURE_DIRECTED_ROUNDING 1 |
| 18 | // CHECK-V8A-ALLOW-FP-INSTR: #define __ARM_FEATURE_NUMERIC_MAXMIN 1 |
| 19 | // CHECK-V8A-ALLOW-FP-INSTR: #define __ARM_FP 0xe |
| 20 | // CHECK-V8A-ALLOW-FP-INSTR: #define __ARM_FP16_ARGS 1 |
| 21 | // CHECK-V8A-ALLOW-FP-INSTR: #define __ARM_FP16_FORMAT_IEEE 1 |
Oliver Stannard | 39ee9de | 2018-04-27 13:56:02 +0000 | [diff] [blame^] | 22 | // CHECK-V8A-ALLOW-FP-INSTR-V8A-NOT: #define __ARM_FEATURE_DOTPROD |
Joey Gouly | 1e8637b | 2013-09-18 10:07:09 +0000 | [diff] [blame] | 23 | |
Sjoerd Meijer | a7463df | 2018-03-13 22:11:06 +0000 | [diff] [blame] | 24 | // RUN: %clang -target arm-none-linux-gnueabi -march=armv8.2a+fp16 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FULLFP16-VECTOR-SCALAR %s |
| 25 | // CHECK-FULLFP16-VECTOR-SCALAR: #define __ARM_FEATURE_FP16_SCALAR_ARITHMETIC 1 |
| 26 | // CHECK-FULLFP16-VECTOR-SCALAR: #define __ARM_FEATURE_FP16_VECTOR_ARITHMETIC 1 |
| 27 | // CHECK-FULLFP16-VECTOR-SCALAR: #define __ARM_FP 0xe |
| 28 | // CHECK-FULLFP16-VECTOR-SCALAR: #define __ARM_FP16_FORMAT_IEEE 1 |
| 29 | |
| 30 | // RUN: %clang -target arm-none-linux-gnueabi -march=armv8.2a+fp16 -mfpu=vfp4 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FULLFP16-SCALAR %s |
| 31 | // CHECK-FULLFP16-SCALAR: #define __ARM_FEATURE_FP16_SCALAR_ARITHMETIC 1 |
| 32 | // CHECK-FULLFP16-SCALAR-NOT: #define __ARM_FEATURE_FP16_VECTOR_ARITHMETIC 1 |
| 33 | // CHECK-FULLFP16-SCALAR: #define __ARM_FP 0xe |
| 34 | // CHECK-FULLFP16-SCALAR: #define __ARM_FP16_FORMAT_IEEE 1 |
Oliver Stannard | 39ee9de | 2018-04-27 13:56:02 +0000 | [diff] [blame^] | 35 | // |
| 36 | // RUN: %clang -target arm-none-linux-gnueabi -march=armv8.2a+dotprod -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-DOTPROD %s |
| 37 | // CHECK-DOTPROD: #define __ARM_FEATURE_DOTPROD 1 |
Sjoerd Meijer | a7463df | 2018-03-13 22:11:06 +0000 | [diff] [blame] | 38 | |
Javed Absar | 00b7444 | 2016-10-07 12:08:41 +0000 | [diff] [blame] | 39 | // RUN: %clang -target armv8r-none-linux-gnu -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V8R %s |
| 40 | // CHECK-V8R: #define __ARMEL__ 1 |
| 41 | // CHECK-V8R: #define __ARM_ARCH 8 |
| 42 | // CHECK-V8R: #define __ARM_ARCH_8R__ 1 |
| 43 | // CHECK-V8R: #define __ARM_FEATURE_CRC32 1 |
| 44 | // CHECK-V8R: #define __ARM_FEATURE_DIRECTED_ROUNDING 1 |
| 45 | // CHECK-V8R: #define __ARM_FEATURE_NUMERIC_MAXMIN 1 |
Keith Walker | 167961f | 2018-02-19 12:40:26 +0000 | [diff] [blame] | 46 | // CHECK-V8R-NOT: #define __ARM_FP 0x |
| 47 | |
| 48 | // RUN: %clang -target armv8r-none-linux-gnueabi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V8R-ALLOW-FP-INSTR %s |
| 49 | // RUN: %clang -target armv8r-none-linux-gnueabihf -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V8R-ALLOW-FP-INSTR %s |
| 50 | // CHECK-V8R-ALLOW-FP-INSTR: #define __ARMEL__ 1 |
| 51 | // CHECK-V8R-ALLOW-FP-INSTR: #define __ARM_ARCH 8 |
| 52 | // CHECK-V8R-ALLOW-FP-INSTR: #define __ARM_ARCH_8R__ 1 |
| 53 | // CHECK-V8R-ALLOW-FP-INSTR: #define __ARM_FEATURE_CRC32 1 |
| 54 | // CHECK-V8R-ALLOW-FP-INSTR: #define __ARM_FEATURE_DIRECTED_ROUNDING 1 |
| 55 | // CHECK-V8R-ALLOW-FP-INSTR: #define __ARM_FEATURE_NUMERIC_MAXMIN 1 |
| 56 | // CHECK-V8R-ALLOW-FP-INSTR: #define __ARM_FP 0xe |
Javed Absar | 00b7444 | 2016-10-07 12:08:41 +0000 | [diff] [blame] | 57 | |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 58 | // RUN: %clang -target armv7a-none-linux-gnu -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V7 %s |
| 59 | // CHECK-V7: #define __ARMEL__ 1 |
| 60 | // CHECK-V7: #define __ARM_ARCH 7 |
| 61 | // CHECK-V7: #define __ARM_ARCH_7A__ 1 |
Nico Rieck | e6a15825 | 2014-02-16 07:29:41 +0000 | [diff] [blame] | 62 | // CHECK-V7-NOT: __ARM_FEATURE_CRC32 |
Pablo Barrio | 1c1b251 | 2016-03-15 19:03:09 +0000 | [diff] [blame] | 63 | // CHECK-V7-NOT: __ARM_FEATURE_NUMERIC_MAXMIN |
James Molloy | 0ffb093 | 2014-09-15 11:25:38 +0000 | [diff] [blame] | 64 | // CHECK-V7-NOT: __ARM_FEATURE_DIRECTED_ROUNDING |
Keith Walker | 167961f | 2018-02-19 12:40:26 +0000 | [diff] [blame] | 65 | // CHECK-V7-NOT: #define __ARM_FP 0x |
| 66 | |
| 67 | // RUN: %clang -target armv7a-none-linux-gnueabi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V7-ALLOW-FP-INSTR %s |
| 68 | // RUN: %clang -target armv7a-none-linux-gnueabihf -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V7-ALLOW-FP-INSTR %s |
| 69 | // CHECK-V7-ALLOW-FP-INSTR: #define __ARMEL__ 1 |
| 70 | // CHECK-V7-ALLOW-FP-INSTR: #define __ARM_ARCH 7 |
| 71 | // CHECK-V7-ALLOW-FP-INSTR: #define __ARM_ARCH_7A__ 1 |
| 72 | // CHECK-V7-ALLOW-FP-INSTR-NOT: __ARM_FEATURE_CRC32 |
| 73 | // CHECK-V7-ALLOW-FP-INSTR-NOT: __ARM_FEATURE_NUMERIC_MAXMIN |
| 74 | // CHECK-V7-ALLOW-FP-INSTR-NOT: __ARM_FEATURE_DIRECTED_ROUNDING |
| 75 | // CHECK-V7-ALLOW-FP-INSTR: #define __ARM_FP 0xc |
Silviu Baranga | e569046 | 2013-10-21 10:59:33 +0000 | [diff] [blame] | 76 | |
George Burgess IV | fc97056 | 2017-02-09 23:30:10 +0000 | [diff] [blame] | 77 | // RUN: %clang -target armv7ve-none-linux-gnu -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V7VE %s |
| 78 | // CHECK-V7VE: #define __ARMEL__ 1 |
| 79 | // CHECK-V7VE: #define __ARM_ARCH 7 |
| 80 | // CHECK-V7VE: #define __ARM_ARCH_7VE__ 1 |
| 81 | // CHECK-V7VE: #define __ARM_ARCH_EXT_IDIV__ 1 |
Keith Walker | 167961f | 2018-02-19 12:40:26 +0000 | [diff] [blame] | 82 | // CHECK-V7VE-NOT: #define __ARM_FP 0x |
| 83 | |
| 84 | // RUN: %clang -target armv7ve-none-linux-gnueabi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V7VE-DEFAULT-ABI-SOFT %s |
| 85 | // RUN: %clang -target armv7ve-none-linux-gnueabihf -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V7VE-DEFAULT-ABI-SOFT %s |
| 86 | // CHECK-V7VE-DEFAULT-ABI-SOFT: #define __ARMEL__ 1 |
| 87 | // CHECK-V7VE-DEFAULT-ABI-SOFT: #define __ARM_ARCH 7 |
| 88 | // CHECK-V7VE-DEFAULT-ABI-SOFT: #define __ARM_ARCH_7VE__ 1 |
| 89 | // CHECK-V7VE-DEFAULT-ABI-SOFT: #define __ARM_ARCH_EXT_IDIV__ 1 |
| 90 | // CHECK-V7VE-DEFAULT-ABI-SOFT: #define __ARM_FP 0xc |
George Burgess IV | fc97056 | 2017-02-09 23:30:10 +0000 | [diff] [blame] | 91 | |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 92 | // RUN: %clang -target x86_64-apple-macosx10.10 -arch armv7s -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V7S %s |
| 93 | // CHECK-V7S: #define __ARMEL__ 1 |
| 94 | // CHECK-V7S: #define __ARM_ARCH 7 |
| 95 | // CHECK-V7S: #define __ARM_ARCH_7S__ 1 |
Tim Northover | 525c73c | 2015-07-21 21:47:33 +0000 | [diff] [blame] | 96 | // CHECK-V7S-NOT: __ARM_FEATURE_CRC32 |
| 97 | // CHECK-V7S-NOT: __ARM_FEATURE_NUMERIC_MAXMIN |
| 98 | // CHECK-V7S-NOT: __ARM_FEATURE_DIRECTED_ROUNDING |
Benjamin Kramer | 3a13ed6 | 2017-12-28 16:58:54 +0000 | [diff] [blame] | 99 | // CHECK-V7S: #define __ARM_FP 0xe |
Tim Northover | 525c73c | 2015-07-21 21:47:33 +0000 | [diff] [blame] | 100 | |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 101 | // RUN: %clang -target armv8a -mfloat-abi=hard -x c -E -dM %s | FileCheck -match-full-lines --check-prefix=CHECK-V8-BAREHF %s |
| 102 | // CHECK-V8-BAREHF: #define __ARMEL__ 1 |
| 103 | // CHECK-V8-BAREHF: #define __ARM_ARCH 8 |
| 104 | // CHECK-V8-BAREHF: #define __ARM_ARCH_8A__ 1 |
| 105 | // CHECK-V8-BAREHF: #define __ARM_FEATURE_CRC32 1 |
| 106 | // CHECK-V8-BAREHF: #define __ARM_FEATURE_DIRECTED_ROUNDING 1 |
| 107 | // CHECK-V8-BAREHF: #define __ARM_FEATURE_NUMERIC_MAXMIN 1 |
Benjamin Kramer | 3a13ed6 | 2017-12-28 16:58:54 +0000 | [diff] [blame] | 108 | // CHECK-V8-BAREHP: #define __ARM_FP 0xe |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 109 | // CHECK-V8-BAREHF: #define __ARM_NEON__ 1 |
| 110 | // CHECK-V8-BAREHF: #define __ARM_PCS_VFP 1 |
| 111 | // CHECK-V8-BAREHF: #define __VFP_FP__ 1 |
Bernard Ogden | da13af3 | 2013-10-24 18:32:51 +0000 | [diff] [blame] | 112 | |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 113 | // 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 Ogden | da13af3 | 2013-10-24 18:32:51 +0000 | [diff] [blame] | 114 | // CHECK-V8-BAREHF-FP-NOT: __ARM_NEON__ 1 |
Benjamin Kramer | 3a13ed6 | 2017-12-28 16:58:54 +0000 | [diff] [blame] | 115 | // CHECK-V8-BAREHP-FP: #define __ARM_FP 0xe |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 116 | // CHECK-V8-BAREHF-FP: #define __VFP_FP__ 1 |
Bernard Ogden | da13af3 | 2013-10-24 18:32:51 +0000 | [diff] [blame] | 117 | |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 118 | // RUN: %clang -target armv8a -mfloat-abi=hard -mfpu=neon-fp-armv8 -x c -E -dM %s | FileCheck -match-full-lines --check-prefix=CHECK-V8-BAREHF-NEON-FP %s |
| 119 | // RUN: %clang -target armv8a -mfloat-abi=hard -mfpu=crypto-neon-fp-armv8 -x c -E -dM %s | FileCheck -match-full-lines --check-prefix=CHECK-V8-BAREHF-NEON-FP %s |
Benjamin Kramer | 3a13ed6 | 2017-12-28 16:58:54 +0000 | [diff] [blame] | 120 | // CHECK-V8-BAREHP-NEON-FP: #define __ARM_FP 0xe |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 121 | // CHECK-V8-BAREHF-NEON-FP: #define __ARM_NEON__ 1 |
| 122 | // CHECK-V8-BAREHF-NEON-FP: #define __VFP_FP__ 1 |
Bernard Ogden | da13af3 | 2013-10-24 18:32:51 +0000 | [diff] [blame] | 123 | |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 124 | // RUN: %clang -target armv8a -mnocrc -x c -E -dM %s | FileCheck -match-full-lines --check-prefix=CHECK-V8-NOCRC %s |
Bernard Ogden | 18b5701 | 2013-10-29 09:47:51 +0000 | [diff] [blame] | 125 | // CHECK-V8-NOCRC-NOT: __ARM_FEATURE_CRC32 1 |
| 126 | |
Silviu Baranga | e569046 | 2013-10-21 10:59:33 +0000 | [diff] [blame] | 127 | // Check that -mhwdiv works properly for armv8/thumbv8 (enabled by default). |
| 128 | |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 129 | // RUN: %clang -target armv8 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8 %s |
| 130 | // RUN: %clang -target armv8 -mthumb -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8 %s |
| 131 | // RUN: %clang -target armv8-eabi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8 %s |
| 132 | // RUN: %clang -target armv8-eabi -mthumb -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8 %s |
Artyom Skrobov | 59f43bb | 2016-03-23 13:32:33 +0000 | [diff] [blame] | 133 | // V8:#define __ARM_ARCH_EXT_IDIV__ 1 |
Silviu Baranga | e569046 | 2013-10-21 10:59:33 +0000 | [diff] [blame] | 134 | |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 135 | // RUN: %clang -target armv8 -mhwdiv=none -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NOHWDIV-V8 %s |
| 136 | // RUN: %clang -target armv8 -mthumb -mhwdiv=none -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NOHWDIV-V8 %s |
| 137 | // RUN: %clang -target armv8 -mhwdiv=thumb -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NOHWDIV-V8 %s |
| 138 | // RUN: %clang -target armv8 -mthumb -mhwdiv=arm -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NOHWDIV-V8 %s |
Artyom Skrobov | 59f43bb | 2016-03-23 13:32:33 +0000 | [diff] [blame] | 139 | // NOHWDIV-V8-NOT:#define __ARM_ARCH_EXT_IDIV__ |
Silviu Baranga | e569046 | 2013-10-21 10:59:33 +0000 | [diff] [blame] | 140 | |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 141 | // RUN: %clang -target armv8a -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8A %s |
| 142 | // RUN: %clang -target armv8a -mthumb -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8A %s |
Artyom Skrobov | 59f43bb | 2016-03-23 13:32:33 +0000 | [diff] [blame] | 143 | // V8A:#define __ARM_ARCH_EXT_IDIV__ 1 |
Keith Walker | 167961f | 2018-02-19 12:40:26 +0000 | [diff] [blame] | 144 | // V8A-NOT:#define __ARM_FP 0x |
| 145 | |
| 146 | // RUN: %clang -target armv8a-eabi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8A-ALLOW-FP-INSTR %s |
| 147 | // RUN: %clang -target armv8a-eabi -mthumb -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8A-ALLOW-FP-INSTR %s |
| 148 | // RUN: %clang -target armv8a-eabihf -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8A-ALLOW-FP-INSTR %s |
| 149 | // RUN: %clang -target armv8a-eabihf -mthumb -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8A-ALLOW-FP-INSTR %s |
| 150 | // V8A-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1 |
| 151 | // V8A-ALLOW-FP-INSTR:#define __ARM_FP 0xe |
Silviu Baranga | e569046 | 2013-10-21 10:59:33 +0000 | [diff] [blame] | 152 | |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 153 | // RUN: %clang -target armv8m.base-none-linux-gnu -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8M_BASELINE %s |
| 154 | // V8M_BASELINE: #define __ARM_ARCH 8 |
| 155 | // V8M_BASELINE: #define __ARM_ARCH_8M_BASE__ 1 |
| 156 | // V8M_BASELINE: #define __ARM_ARCH_EXT_IDIV__ 1 |
Bradley Smith | f4affc1 | 2016-03-03 13:52:22 +0000 | [diff] [blame] | 157 | // V8M_BASELINE-NOT: __ARM_ARCH_ISA_ARM |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 158 | // V8M_BASELINE: #define __ARM_ARCH_ISA_THUMB 1 |
| 159 | // V8M_BASELINE: #define __ARM_ARCH_PROFILE 'M' |
Bradley Smith | f4affc1 | 2016-03-03 13:52:22 +0000 | [diff] [blame] | 160 | // V8M_BASELINE-NOT: __ARM_FEATURE_CRC32 |
| 161 | // V8M_BASELINE-NOT: __ARM_FEATURE_DSP |
| 162 | // V8M_BASELINE-NOT: __ARM_FP 0x{{.*}} |
| 163 | // V8M_BASELINE-NOT: __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 |
| 164 | |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 165 | // RUN: %clang -target armv8m.main-none-linux-gnu -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8M_MAINLINE %s |
| 166 | // V8M_MAINLINE: #define __ARM_ARCH 8 |
| 167 | // V8M_MAINLINE: #define __ARM_ARCH_8M_MAIN__ 1 |
| 168 | // V8M_MAINLINE: #define __ARM_ARCH_EXT_IDIV__ 1 |
Bradley Smith | f4affc1 | 2016-03-03 13:52:22 +0000 | [diff] [blame] | 169 | // V8M_MAINLINE-NOT: __ARM_ARCH_ISA_ARM |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 170 | // V8M_MAINLINE: #define __ARM_ARCH_ISA_THUMB 2 |
| 171 | // V8M_MAINLINE: #define __ARM_ARCH_PROFILE 'M' |
Bradley Smith | f4affc1 | 2016-03-03 13:52:22 +0000 | [diff] [blame] | 172 | // V8M_MAINLINE-NOT: __ARM_FEATURE_CRC32 |
| 173 | // V8M_MAINLINE-NOT: __ARM_FEATURE_DSP |
Keith Walker | 167961f | 2018-02-19 12:40:26 +0000 | [diff] [blame] | 174 | // V8M_MAINLINE-NOT: #define __ARM_FP 0x |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 175 | // V8M_MAINLINE: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1 |
Bradley Smith | f4affc1 | 2016-03-03 13:52:22 +0000 | [diff] [blame] | 176 | |
Keith Walker | 167961f | 2018-02-19 12:40:26 +0000 | [diff] [blame] | 177 | // RUN: %clang -target armv8m.main-none-linux-gnueabi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8M-MAINLINE-ALLOW-FP-INSTR %s |
| 178 | // RUN: %clang -target armv8m.main-none-linux-gnueabihf -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8M-MAINLINE-ALLOW-FP-INSTR %s |
| 179 | // V8M-MAINLINE-ALLOW-FP-INSTR: #define __ARM_ARCH 8 |
| 180 | // V8M-MAINLINE-ALLOW-FP-INSTR: #define __ARM_ARCH_8M_MAIN__ 1 |
| 181 | // V8M-MAINLINE-ALLOW-FP-INSTR: #define __ARM_ARCH_EXT_IDIV__ 1 |
| 182 | // V8M-MAINLINE-ALLOW-FP-INSTR-NOT: __ARM_ARCH_ISA_ARM |
| 183 | // V8M-MAINLINE-ALLOW-FP-INSTR: #define __ARM_ARCH_ISA_THUMB 2 |
| 184 | // V8M-MAINLINE-ALLOW-FP-INSTR: #define __ARM_ARCH_PROFILE 'M' |
| 185 | // V8M-MAINLINE-ALLOW-FP-INSTR-NOT: __ARM_FEATURE_CRC32 |
| 186 | // V8M-MAINLINE-ALLOW-FP-INSTR-NOT: __ARM_FEATURE_DSP |
| 187 | // V8M-MAINLINE-ALLOW-FP-INSTR: #define __ARM_FP 0xe |
| 188 | // V8M-MAINLINE-ALLOW-FP-INSTR: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1 |
| 189 | |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 190 | // RUN: %clang -target arm-none-linux-gnu -march=armv8-m.main+dsp -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8M_MAINLINE_DSP %s |
| 191 | // V8M_MAINLINE_DSP: #define __ARM_ARCH 8 |
| 192 | // V8M_MAINLINE_DSP: #define __ARM_ARCH_8M_MAIN__ 1 |
| 193 | // V8M_MAINLINE_DSP: #define __ARM_ARCH_EXT_IDIV__ 1 |
Bradley Smith | f4affc1 | 2016-03-03 13:52:22 +0000 | [diff] [blame] | 194 | // V8M_MAINLINE_DSP-NOT: __ARM_ARCH_ISA_ARM |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 195 | // V8M_MAINLINE_DSP: #define __ARM_ARCH_ISA_THUMB 2 |
| 196 | // V8M_MAINLINE_DSP: #define __ARM_ARCH_PROFILE 'M' |
Bradley Smith | f4affc1 | 2016-03-03 13:52:22 +0000 | [diff] [blame] | 197 | // V8M_MAINLINE_DSP-NOT: __ARM_FEATURE_CRC32 |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 198 | // V8M_MAINLINE_DSP: #define __ARM_FEATURE_DSP 1 |
Keith Walker | 167961f | 2018-02-19 12:40:26 +0000 | [diff] [blame] | 199 | // V8M_MAINLINE_DSP-NOT: #define __ARM_FP 0x |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 200 | // V8M_MAINLINE_DSP: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1 |
Bradley Smith | f4affc1 | 2016-03-03 13:52:22 +0000 | [diff] [blame] | 201 | |
Keith Walker | 167961f | 2018-02-19 12:40:26 +0000 | [diff] [blame] | 202 | // RUN: %clang -target arm-none-linux-gnueabi -march=armv8-m.main+dsp -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=V8M-MAINLINE-DSP-ALLOW-FP-INSTR %s |
| 203 | // V8M-MAINLINE-DSP-ALLOW-FP-INSTR: #define __ARM_ARCH 8 |
| 204 | // V8M-MAINLINE-DSP-ALLOW-FP-INSTR: #define __ARM_ARCH_8M_MAIN__ 1 |
| 205 | // V8M-MAINLINE-DSP-ALLOW-FP-INSTR: #define __ARM_ARCH_EXT_IDIV__ 1 |
| 206 | // V8M-MAINLINE-DSP-ALLOW-FP-INSTR-NOT: __ARM_ARCH_ISA_ARM |
| 207 | // V8M-MAINLINE-DSP-ALLOW-FP-INSTR: #define __ARM_ARCH_ISA_THUMB 2 |
| 208 | // V8M-MAINLINE-DSP-ALLOW-FP-INSTR: #define __ARM_ARCH_PROFILE 'M' |
| 209 | // V8M-MAINLINE-DSP-ALLOW-FP-INSTR-NOT: __ARM_FEATURE_CRC32 |
| 210 | // V8M-MAINLINE-DSP-ALLOW-FP-INSTR: #define __ARM_FEATURE_DSP 1 |
| 211 | // V8M-MAINLINE-DSP-ALLOW-FP-INSTR: #define __ARM_FP 0xe |
| 212 | // V8M-MAINLINE-DSP-ALLOW-FP-INSTR: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1 |
| 213 | |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 214 | // RUN: %clang -target arm-none-linux-gnu -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-DEFS %s |
Alexandros Lamprineas | f5a8e6c | 2015-10-02 14:56:37 +0000 | [diff] [blame] | 215 | // CHECK-DEFS:#define __ARM_PCS 1 |
Bradley Smith | 0f28f0c | 2014-01-20 10:52:00 +0000 | [diff] [blame] | 216 | // CHECK-DEFS:#define __ARM_SIZEOF_MINIMAL_ENUM 4 |
| 217 | // CHECK-DEFS:#define __ARM_SIZEOF_WCHAR_T 4 |
| 218 | |
Alexandros Lamprineas | f5a8e6c | 2015-10-02 14:56:37 +0000 | [diff] [blame] | 219 | // RUN: %clang -target arm-none-linux-gnu -fno-math-errno -fno-signed-zeros\ |
| 220 | // RUN: -fno-trapping-math -fassociative-math -freciprocal-math\ |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 221 | // RUN: -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FASTMATH %s |
Alexandros Lamprineas | f5a8e6c | 2015-10-02 14:56:37 +0000 | [diff] [blame] | 222 | // RUN: %clang -target arm-none-linux-gnu -ffast-math -x c -E -dM %s -o -\ |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 223 | // RUN: | FileCheck -match-full-lines --check-prefix=CHECK-FASTMATH %s |
| 224 | // CHECK-FASTMATH: #define __ARM_FP_FAST 1 |
Alexandros Lamprineas | f5a8e6c | 2015-10-02 14:56:37 +0000 | [diff] [blame] | 225 | |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 226 | // 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 Smith | 0f28f0c | 2014-01-20 10:52:00 +0000 | [diff] [blame] | 227 | // CHECK-SHORTWCHAR:#define __ARM_SIZEOF_WCHAR_T 2 |
| 228 | |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 229 | // 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 Smith | 0f28f0c | 2014-01-20 10:52:00 +0000 | [diff] [blame] | 230 | // CHECK-SHORTENUMS:#define __ARM_SIZEOF_MINIMAL_ENUM 1 |
Silviu Baranga | e569046 | 2013-10-21 10:59:33 +0000 | [diff] [blame] | 231 | |
| 232 | // Test that -mhwdiv has the right effect for a target CPU which has hwdiv enabled by default. |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 233 | // RUN: %clang -target armv7 -mcpu=cortex-a15 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=HWDIV %s |
| 234 | // RUN: %clang -target armv7 -mthumb -mcpu=cortex-a15 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=HWDIV %s |
| 235 | // RUN: %clang -target armv7 -mcpu=cortex-a15 -mhwdiv=arm -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=HWDIV %s |
| 236 | // RUN: %clang -target armv7 -mthumb -mcpu=cortex-a15 -mhwdiv=thumb -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=HWDIV %s |
Artyom Skrobov | 59f43bb | 2016-03-23 13:32:33 +0000 | [diff] [blame] | 237 | // HWDIV:#define __ARM_ARCH_EXT_IDIV__ 1 |
Silviu Baranga | e569046 | 2013-10-21 10:59:33 +0000 | [diff] [blame] | 238 | |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 239 | // RUN: %clang -target arm -mcpu=cortex-a15 -mhwdiv=thumb -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NOHWDIV %s |
| 240 | // RUN: %clang -target arm -mthumb -mcpu=cortex-a15 -mhwdiv=arm -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NOHWDIV %s |
| 241 | // RUN: %clang -target arm -mcpu=cortex-a15 -mhwdiv=none -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NOHWDIV %s |
| 242 | // RUN: %clang -target arm -mthumb -mcpu=cortex-a15 -mhwdiv=none -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NOHWDIV %s |
Artyom Skrobov | 59f43bb | 2016-03-23 13:32:33 +0000 | [diff] [blame] | 243 | // NOHWDIV-NOT:#define __ARM_ARCH_EXT_IDIV__ |
Silviu Baranga | e569046 | 2013-10-21 10:59:33 +0000 | [diff] [blame] | 244 | |
Artyom Skrobov | 53b000a8 | 2013-11-21 14:04:38 +0000 | [diff] [blame] | 245 | |
| 246 | // Check that -mfpu works properly for Cortex-A7 (enabled by default). |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 247 | // RUN: %clang -target armv7-none-linux-gnueabi -mcpu=cortex-a7 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=DEFAULTFPU-A7 %s |
| 248 | // RUN: %clang -target armv7-none-linux-gnueabi -mthumb -mcpu=cortex-a7 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=DEFAULTFPU-A7 %s |
Keith Walker | 167961f | 2018-02-19 12:40:26 +0000 | [diff] [blame] | 249 | // RUN: %clang -target armv7-none-linux-gnueabihf -mcpu=cortex-a7 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=DEFAULTFPU-A7 %s |
| 250 | // RUN: %clang -target armv7-none-linux-gnueabihf -mthumb -mcpu=cortex-a7 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=DEFAULTFPU-A7 %s |
Benjamin Kramer | 3a13ed6 | 2017-12-28 16:58:54 +0000 | [diff] [blame] | 251 | // DEFAULTFPU-A7:#define __ARM_FP 0xe |
Artyom Skrobov | 53b000a8 | 2013-11-21 14:04:38 +0000 | [diff] [blame] | 252 | // DEFAULTFPU-A7:#define __ARM_NEON__ 1 |
| 253 | // DEFAULTFPU-A7:#define __ARM_VFPV4__ 1 |
| 254 | |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 255 | // RUN: %clang -target armv7-none-linux-gnueabi -mcpu=cortex-a7 -mfpu=none -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=FPUNONE-A7 %s |
| 256 | // RUN: %clang -target armv7-none-linux-gnueabi -mthumb -mcpu=cortex-a7 -mfpu=none -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=FPUNONE-A7 %s |
Richard Barton | 7dacc24 | 2015-10-21 10:03:55 +0000 | [diff] [blame] | 257 | // FPUNONE-A7-NOT:#define __ARM_FP 0x{{.*}} |
Artyom Skrobov | 53b000a8 | 2013-11-21 14:04:38 +0000 | [diff] [blame] | 258 | // FPUNONE-A7-NOT:#define __ARM_NEON__ 1 |
| 259 | // FPUNONE-A7-NOT:#define __ARM_VFPV4__ 1 |
| 260 | |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 261 | // RUN: %clang -target armv7-none-linux-gnueabi -mcpu=cortex-a7 -mfpu=vfp4 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NONEON-A7 %s |
| 262 | // RUN: %clang -target armv7-none-linux-gnueabi -mthumb -mcpu=cortex-a7 -mfpu=vfp4 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NONEON-A7 %s |
Benjamin Kramer | 3a13ed6 | 2017-12-28 16:58:54 +0000 | [diff] [blame] | 263 | // NONEON-A7:#define __ARM_FP 0xe |
Artyom Skrobov | 53b000a8 | 2013-11-21 14:04:38 +0000 | [diff] [blame] | 264 | // NONEON-A7-NOT:#define __ARM_NEON__ 1 |
| 265 | // NONEON-A7:#define __ARM_VFPV4__ 1 |
| 266 | |
Amara Emerson | a1daec7 | 2013-11-25 13:18:59 +0000 | [diff] [blame] | 267 | // Check that -mfpu works properly for Cortex-A5 (enabled by default). |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 268 | // RUN: %clang -target armv7-none-linux-gnueabi -mcpu=cortex-a5 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=DEFAULTFPU-A5 %s |
| 269 | // RUN: %clang -target armv7-none-linux-gnueabi -mthumb -mcpu=cortex-a5 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=DEFAULTFPU-A5 %s |
Benjamin Kramer | 3a13ed6 | 2017-12-28 16:58:54 +0000 | [diff] [blame] | 270 | // DEFAULTFPU-A5:#define __ARM_FP 0xe |
Amara Emerson | a1daec7 | 2013-11-25 13:18:59 +0000 | [diff] [blame] | 271 | // DEFAULTFPU-A5:#define __ARM_NEON__ 1 |
| 272 | // DEFAULTFPU-A5:#define __ARM_VFPV4__ 1 |
| 273 | |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 274 | // RUN: %clang -target armv7-none-linux-gnueabi -mcpu=cortex-a5 -mfpu=none -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=FPUNONE-A5 %s |
| 275 | // RUN: %clang -target armv7-none-linux-gnueabi -mthumb -mcpu=cortex-a5 -mfpu=none -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=FPUNONE-A5 %s |
Richard Barton | 7dacc24 | 2015-10-21 10:03:55 +0000 | [diff] [blame] | 276 | // FPUNONE-A5-NOT:#define __ARM_FP 0x{{.*}} |
Amara Emerson | a1daec7 | 2013-11-25 13:18:59 +0000 | [diff] [blame] | 277 | // FPUNONE-A5-NOT:#define __ARM_NEON__ 1 |
| 278 | // FPUNONE-A5-NOT:#define __ARM_VFPV4__ 1 |
| 279 | |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 280 | // RUN: %clang -target armv7-none-linux-gnueabi -mcpu=cortex-a5 -mfpu=vfp4-d16 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NONEON-A5 %s |
| 281 | // RUN: %clang -target armv7-none-linux-gnueabi -mthumb -mcpu=cortex-a5 -mfpu=vfp4-d16 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=NONEON-A5 %s |
Benjamin Kramer | 3a13ed6 | 2017-12-28 16:58:54 +0000 | [diff] [blame] | 282 | // NONEON-A5:#define __ARM_FP 0xe |
Amara Emerson | a1daec7 | 2013-11-25 13:18:59 +0000 | [diff] [blame] | 283 | // NONEON-A5-NOT:#define __ARM_NEON__ 1 |
| 284 | // NONEON-A5:#define __ARM_VFPV4__ 1 |
| 285 | |
Silviu Baranga | e569046 | 2013-10-21 10:59:33 +0000 | [diff] [blame] | 286 | // FIXME: add check for further predefines |
Sergey Dmitrouk | 745f530 | 2014-11-25 08:57:36 +0000 | [diff] [blame] | 287 | // Test whether predefines are as expected when targeting ep9312. |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 288 | // RUN: %clang -target armv4t -mcpu=ep9312 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A4T %s |
Sergey Dmitrouk | 745f530 | 2014-11-25 08:57:36 +0000 | [diff] [blame] | 289 | // A4T-NOT:#define __ARM_FEATURE_DSP |
Richard Barton | 7dacc24 | 2015-10-21 10:03:55 +0000 | [diff] [blame] | 290 | // A4T-NOT:#define __ARM_FP 0x{{.*}} |
Sergey Dmitrouk | 745f530 | 2014-11-25 08:57:36 +0000 | [diff] [blame] | 291 | |
| 292 | // Test whether predefines are as expected when targeting arm10tdmi. |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 293 | // RUN: %clang -target armv5 -mcpu=arm10tdmi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A5T %s |
Sergey Dmitrouk | 745f530 | 2014-11-25 08:57:36 +0000 | [diff] [blame] | 294 | // A5T-NOT:#define __ARM_FEATURE_DSP |
Richard Barton | 7dacc24 | 2015-10-21 10:03:55 +0000 | [diff] [blame] | 295 | // A5T-NOT:#define __ARM_FP 0x{{.*}} |
Sergey Dmitrouk | 745f530 | 2014-11-25 08:57:36 +0000 | [diff] [blame] | 296 | |
Keith Walker | 167961f | 2018-02-19 12:40:26 +0000 | [diff] [blame] | 297 | // Test whether predefines are as expected when targeting cortex-a5i (soft FP ABI as default). |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 298 | // RUN: %clang -target armv7 -mcpu=cortex-a5 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A5 %s |
| 299 | // RUN: %clang -target armv7 -mthumb -mcpu=cortex-a5 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A5 %s |
Amara Emerson | a1daec7 | 2013-11-25 13:18:59 +0000 | [diff] [blame] | 300 | // A5:#define __ARM_ARCH 7 |
| 301 | // A5:#define __ARM_ARCH_7A__ 1 |
Artyom Skrobov | 59f43bb | 2016-03-23 13:32:33 +0000 | [diff] [blame] | 302 | // A5-NOT:#define __ARM_ARCH_EXT_IDIV__ |
Saleem Abdulrasool | 52a5d41 | 2014-06-15 18:48:41 +0000 | [diff] [blame] | 303 | // A5:#define __ARM_ARCH_PROFILE 'A' |
Martell Malone | c950c65 | 2017-11-29 07:25:12 +0000 | [diff] [blame] | 304 | // A5-NOT:#define __ARM_DWARF_EH__ 1 |
James Molloy | 0ffb093 | 2014-09-15 11:25:38 +0000 | [diff] [blame] | 305 | // A5-NOT: #define __ARM_FEATURE_DIRECTED_ROUNDING |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 306 | // A5:#define __ARM_FEATURE_DSP 1 |
Artyom Skrobov | 59f43bb | 2016-03-23 13:32:33 +0000 | [diff] [blame] | 307 | // A5-NOT: #define __ARM_FEATURE_NUMERIC_MAXMIN |
Keith Walker | 167961f | 2018-02-19 12:40:26 +0000 | [diff] [blame] | 308 | // A5-NOT:#define __ARM_FP 0x |
Amara Emerson | a1daec7 | 2013-11-25 13:18:59 +0000 | [diff] [blame] | 309 | |
Keith Walker | 167961f | 2018-02-19 12:40:26 +0000 | [diff] [blame] | 310 | // Test whether predefines are as expected when targeting cortex-a5 (softfp FP ABI as default). |
| 311 | // RUN: %clang -target armv7-eabi -mcpu=cortex-a5 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A5-ALLOW-FP-INSTR %s |
| 312 | // RUN: %clang -target armv7-eabi -mthumb -mcpu=cortex-a5 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A5-ALLOW-FP-INSTR %s |
| 313 | // A5-ALLOW-FP-INSTR:#define __ARM_ARCH 7 |
| 314 | // A5-ALLOW-FP-INSTR:#define __ARM_ARCH_7A__ 1 |
| 315 | // A5-ALLOW-FP-INSTR-NOT:#define __ARM_ARCH_EXT_IDIV__ |
| 316 | // A5-ALLOW-FP-INSTR:#define __ARM_ARCH_PROFILE 'A' |
| 317 | // A5-ALLOW-FP-INSTR-NOT: #define __ARM_FEATURE_DIRECTED_ROUNDING |
| 318 | // A5-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1 |
| 319 | // A5-ALLOW-FP-INSTR-NOT: #define __ARM_FEATURE_NUMERIC_MAXMIN |
| 320 | // A5-ALLOW-FP-INSTR:#define __ARM_FP 0xe |
| 321 | |
| 322 | // Test whether predefines are as expected when targeting cortex-a7 (soft FP ABI as default). |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 323 | // RUN: %clang -target armv7k -mcpu=cortex-a7 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A7 %s |
| 324 | // RUN: %clang -target armv7k -mthumb -mcpu=cortex-a7 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A7 %s |
Artyom Skrobov | 53b000a8 | 2013-11-21 14:04:38 +0000 | [diff] [blame] | 325 | // A7:#define __ARM_ARCH 7 |
Artyom Skrobov | 53b000a8 | 2013-11-21 14:04:38 +0000 | [diff] [blame] | 326 | // A7:#define __ARM_ARCH_EXT_IDIV__ 1 |
Saleem Abdulrasool | 52a5d41 | 2014-06-15 18:48:41 +0000 | [diff] [blame] | 327 | // A7:#define __ARM_ARCH_PROFILE 'A' |
Martell Malone | c950c65 | 2017-11-29 07:25:12 +0000 | [diff] [blame] | 328 | // A7-NOT:#define __ARM_DWARF_EH__ 1 |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 329 | // A7:#define __ARM_FEATURE_DSP 1 |
Keith Walker | 167961f | 2018-02-19 12:40:26 +0000 | [diff] [blame] | 330 | // A7-NOT:#define __ARM_FP 0x |
| 331 | |
| 332 | // Test whether predefines are as expected when targeting cortex-a7 (softfp FP ABI as default). |
| 333 | // RUN: %clang -target armv7k-eabi -mcpu=cortex-a7 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A7-ALLOW-FP-INSTR %s |
| 334 | // RUN: %clang -target armv7k-eabi -mthumb -mcpu=cortex-a7 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A7-ALLOW-FP-INSTR %s |
| 335 | // A7-ALLOW-FP-INSTR:#define __ARM_ARCH 7 |
| 336 | // A7-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1 |
| 337 | // A7-ALLOW-FP-INSTR:#define __ARM_ARCH_PROFILE 'A' |
| 338 | // A7-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1 |
| 339 | // A7-ALLOW-FP-INSTR:#define __ARM_FP 0xe |
Artyom Skrobov | 53b000a8 | 2013-11-21 14:04:38 +0000 | [diff] [blame] | 340 | |
Tim Northover | 3261799 | 2016-04-28 14:01:49 +0000 | [diff] [blame] | 341 | // Test whether predefines are as expected when targeting cortex-a7. |
| 342 | // RUN: %clang -target x86_64-apple-darwin -arch armv7k -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV7K %s |
| 343 | // ARMV7K:#define __ARM_ARCH 7 |
| 344 | // ARMV7K:#define __ARM_ARCH_EXT_IDIV__ 1 |
| 345 | // ARMV7K:#define __ARM_ARCH_PROFILE 'A' |
Chris Bieneman | 46977b6 | 2016-04-29 17:53:00 +0000 | [diff] [blame] | 346 | // ARMV7K:#define __ARM_DWARF_EH__ 1 |
Tim Northover | 3261799 | 2016-04-28 14:01:49 +0000 | [diff] [blame] | 347 | // ARMV7K:#define __ARM_FEATURE_DSP 1 |
Benjamin Kramer | 3a13ed6 | 2017-12-28 16:58:54 +0000 | [diff] [blame] | 348 | // ARMV7K:#define __ARM_FP 0xe |
Tim Northover | 3261799 | 2016-04-28 14:01:49 +0000 | [diff] [blame] | 349 | // ARMV7K:#define __ARM_PCS_VFP 1 |
| 350 | |
| 351 | |
Keith Walker | 167961f | 2018-02-19 12:40:26 +0000 | [diff] [blame] | 352 | // Test whether predefines are as expected when targeting cortex-a8 (soft FP ABI as default). |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 353 | // RUN: %clang -target armv7 -mcpu=cortex-a8 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A8 %s |
| 354 | // RUN: %clang -target armv7 -mthumb -mcpu=cortex-a8 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A8 %s |
Artyom Skrobov | 59f43bb | 2016-03-23 13:32:33 +0000 | [diff] [blame] | 355 | // A8-NOT:#define __ARM_ARCH_EXT_IDIV__ |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 356 | // A8:#define __ARM_FEATURE_DSP 1 |
Keith Walker | 167961f | 2018-02-19 12:40:26 +0000 | [diff] [blame] | 357 | // A8-NOT:#define __ARM_FP 0x |
Silviu Baranga | e569046 | 2013-10-21 10:59:33 +0000 | [diff] [blame] | 358 | |
Keith Walker | 167961f | 2018-02-19 12:40:26 +0000 | [diff] [blame] | 359 | // Test whether predefines are as expected when targeting cortex-a8 (softfp FP ABI as default). |
| 360 | // RUN: %clang -target armv7-eabi -mcpu=cortex-a8 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A8-ALLOW-FP-INSTR %s |
| 361 | // RUN: %clang -target armv7-eabi -mthumb -mcpu=cortex-a8 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A8-ALLOW-FP-INSTR %s |
| 362 | // A8-ALLOW-FP-INSTR-NOT:#define __ARM_ARCH_EXT_IDIV__ |
| 363 | // A8-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1 |
| 364 | // A8-ALLOW-FP-INSTR:#define __ARM_FP 0xc |
| 365 | |
| 366 | // Test whether predefines are as expected when targeting cortex-a9 (soft FP as default). |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 367 | // RUN: %clang -target armv7 -mcpu=cortex-a9 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A9 %s |
| 368 | // RUN: %clang -target armv7 -mthumb -mcpu=cortex-a9 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A9 %s |
Artyom Skrobov | 59f43bb | 2016-03-23 13:32:33 +0000 | [diff] [blame] | 369 | // A9-NOT:#define __ARM_ARCH_EXT_IDIV__ |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 370 | // A9:#define __ARM_FEATURE_DSP 1 |
Keith Walker | 167961f | 2018-02-19 12:40:26 +0000 | [diff] [blame] | 371 | // A9-NOT:#define __ARM_FP 0x |
| 372 | |
| 373 | // Test whether predefines are as expected when targeting cortex-a9 (softfp FP as default). |
| 374 | // RUN: %clang -target armv7-eabi -mcpu=cortex-a9 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A9-ALLOW-FP-INSTR %s |
| 375 | // RUN: %clang -target armv7-eabi -mthumb -mcpu=cortex-a9 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A9-ALLOW-FP-INSTR %s |
| 376 | // A9-ALLOW-FP-INSTR-NOT:#define __ARM_ARCH_EXT_IDIV__ |
| 377 | // A9-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1 |
| 378 | // A9-ALLOW-FP-INSTR:#define __ARM_FP 0xe |
Silviu Baranga | e569046 | 2013-10-21 10:59:33 +0000 | [diff] [blame] | 379 | |
Richard Barton | 3b82ed3 | 2013-11-22 11:53:28 +0000 | [diff] [blame] | 380 | |
| 381 | // Check that -mfpu works properly for Cortex-A12 (enabled by default). |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 382 | // RUN: %clang -target armv7-none-linux-gnueabi -mcpu=cortex-a12 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=DEFAULTFPU-A12 %s |
| 383 | // RUN: %clang -target armv7-none-linux-gnueabi -mthumb -mcpu=cortex-a12 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=DEFAULTFPU-A12 %s |
Benjamin Kramer | 3a13ed6 | 2017-12-28 16:58:54 +0000 | [diff] [blame] | 384 | // DEFAULTFPU-A12:#define __ARM_FP 0xe |
Richard Barton | 3b82ed3 | 2013-11-22 11:53:28 +0000 | [diff] [blame] | 385 | // DEFAULTFPU-A12:#define __ARM_NEON__ 1 |
| 386 | // DEFAULTFPU-A12:#define __ARM_VFPV4__ 1 |
| 387 | |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 388 | // RUN: %clang -target armv7-none-linux-gnueabi -mcpu=cortex-a12 -mfpu=none -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=FPUNONE-A12 %s |
| 389 | // RUN: %clang -target armv7-none-linux-gnueabi -mthumb -mcpu=cortex-a12 -mfpu=none -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=FPUNONE-A12 %s |
Richard Barton | 7dacc24 | 2015-10-21 10:03:55 +0000 | [diff] [blame] | 390 | // FPUNONE-A12-NOT:#define __ARM_FP 0x{{.*}} |
Richard Barton | 3b82ed3 | 2013-11-22 11:53:28 +0000 | [diff] [blame] | 391 | // FPUNONE-A12-NOT:#define __ARM_NEON__ 1 |
| 392 | // FPUNONE-A12-NOT:#define __ARM_VFPV4__ 1 |
| 393 | |
Keith Walker | 167961f | 2018-02-19 12:40:26 +0000 | [diff] [blame] | 394 | // Test whether predefines are as expected when targeting cortex-a12 (soft FP ABI as default). |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 395 | // RUN: %clang -target armv7 -mcpu=cortex-a12 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A12 %s |
| 396 | // RUN: %clang -target armv7 -mthumb -mcpu=cortex-a12 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A12 %s |
Richard Barton | 3b82ed3 | 2013-11-22 11:53:28 +0000 | [diff] [blame] | 397 | // A12:#define __ARM_ARCH 7 |
| 398 | // A12:#define __ARM_ARCH_7A__ 1 |
| 399 | // A12:#define __ARM_ARCH_EXT_IDIV__ 1 |
Saleem Abdulrasool | 52a5d41 | 2014-06-15 18:48:41 +0000 | [diff] [blame] | 400 | // A12:#define __ARM_ARCH_PROFILE 'A' |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 401 | // A12:#define __ARM_FEATURE_DSP 1 |
Keith Walker | 167961f | 2018-02-19 12:40:26 +0000 | [diff] [blame] | 402 | // A12-NOT:#define __ARM_FP 0x |
Richard Barton | 3b82ed3 | 2013-11-22 11:53:28 +0000 | [diff] [blame] | 403 | |
Keith Walker | 167961f | 2018-02-19 12:40:26 +0000 | [diff] [blame] | 404 | // Test whether predefines are as expected when targeting cortex-a12 (soft FP ABI as default). |
| 405 | // RUN: %clang -target armv7-eabi -mcpu=cortex-a12 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A12-ALLOW-FP-INSTR %s |
| 406 | // RUN: %clang -target armv7-eabi -mthumb -mcpu=cortex-a12 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A12-ALLOW-FP-INSTR %s |
| 407 | // A12-ALLOW-FP-INSTR:#define __ARM_ARCH 7 |
| 408 | // A12-ALLOW-FP-INSTR:#define __ARM_ARCH_7A__ 1 |
| 409 | // A12-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1 |
| 410 | // A12-ALLOW-FP-INSTR:#define __ARM_ARCH_PROFILE 'A' |
| 411 | // A12-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1 |
| 412 | // A12-ALLOW-FP-INSTR:#define __ARM_FP 0xe |
| 413 | |
| 414 | // Test whether predefines are as expected when targeting cortex-a15 (soft FP ABI as default). |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 415 | // RUN: %clang -target armv7 -mcpu=cortex-a15 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A15 %s |
| 416 | // RUN: %clang -target armv7 -mthumb -mcpu=cortex-a15 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A15 %s |
Artyom Skrobov | 59f43bb | 2016-03-23 13:32:33 +0000 | [diff] [blame] | 417 | // A15:#define __ARM_ARCH_EXT_IDIV__ 1 |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 418 | // A15:#define __ARM_FEATURE_DSP 1 |
Keith Walker | 167961f | 2018-02-19 12:40:26 +0000 | [diff] [blame] | 419 | // A15-NOT:#define __ARM_FP 0x |
| 420 | |
| 421 | // Test whether predefines are as expected when targeting cortex-a15 (softfp ABI as default). |
| 422 | // RUN: %clang -target armv7-eabi -mcpu=cortex-a15 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A15-ALLOW-FP-INSTR %s |
| 423 | // RUN: %clang -target armv7-eabi -mthumb -mcpu=cortex-a15 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A15-ALLOW-FP-INSTR %s |
| 424 | // A15-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1 |
| 425 | // A15-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1 |
| 426 | // A15-ALLOW-FP-INSTR:#define __ARM_FP 0xe |
Silviu Baranga | e569046 | 2013-10-21 10:59:33 +0000 | [diff] [blame] | 427 | |
Renato Golin | 5886bc3 | 2014-10-13 10:22:48 +0000 | [diff] [blame] | 428 | // Check that -mfpu works properly for Cortex-A17 (enabled by default). |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 429 | // RUN: %clang -target armv7-none-linux-gnueabi -mcpu=cortex-a17 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=DEFAULTFPU-A17 %s |
| 430 | // RUN: %clang -target armv7-none-linux-gnueabi -mthumb -mcpu=cortex-a17 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=DEFAULTFPU-A17 %s |
Benjamin Kramer | 3a13ed6 | 2017-12-28 16:58:54 +0000 | [diff] [blame] | 431 | // DEFAULTFPU-A17:#define __ARM_FP 0xe |
Renato Golin | 5886bc3 | 2014-10-13 10:22:48 +0000 | [diff] [blame] | 432 | // DEFAULTFPU-A17:#define __ARM_NEON__ 1 |
| 433 | // DEFAULTFPU-A17:#define __ARM_VFPV4__ 1 |
| 434 | |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 435 | // RUN: %clang -target armv7-none-linux-gnueabi -mcpu=cortex-a17 -mfpu=none -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=FPUNONE-A17 %s |
| 436 | // RUN: %clang -target armv7-none-linux-gnueabi -mthumb -mcpu=cortex-a17 -mfpu=none -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=FPUNONE-A17 %s |
Richard Barton | 7dacc24 | 2015-10-21 10:03:55 +0000 | [diff] [blame] | 437 | // FPUNONE-A17-NOT:#define __ARM_FP 0x{{.*}} |
Renato Golin | 5886bc3 | 2014-10-13 10:22:48 +0000 | [diff] [blame] | 438 | // FPUNONE-A17-NOT:#define __ARM_NEON__ 1 |
| 439 | // FPUNONE-A17-NOT:#define __ARM_VFPV4__ 1 |
| 440 | |
Keith Walker | 167961f | 2018-02-19 12:40:26 +0000 | [diff] [blame] | 441 | // Test whether predefines are as expected when targeting cortex-a17 (soft FP ABI as default). |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 442 | // RUN: %clang -target armv7 -mcpu=cortex-a17 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A17 %s |
| 443 | // RUN: %clang -target armv7 -mthumb -mcpu=cortex-a17 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A17 %s |
Renato Golin | 5886bc3 | 2014-10-13 10:22:48 +0000 | [diff] [blame] | 444 | // A17:#define __ARM_ARCH 7 |
| 445 | // A17:#define __ARM_ARCH_7A__ 1 |
| 446 | // A17:#define __ARM_ARCH_EXT_IDIV__ 1 |
| 447 | // A17:#define __ARM_ARCH_PROFILE 'A' |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 448 | // A17:#define __ARM_FEATURE_DSP 1 |
Keith Walker | 167961f | 2018-02-19 12:40:26 +0000 | [diff] [blame] | 449 | // A17-NOT:#define __ARM_FP 0x |
Renato Golin | 5886bc3 | 2014-10-13 10:22:48 +0000 | [diff] [blame] | 450 | |
Keith Walker | 167961f | 2018-02-19 12:40:26 +0000 | [diff] [blame] | 451 | // Test whether predefines are as expected when targeting cortex-a17 (softfp FP ABI as default). |
| 452 | // RUN: %clang -target armv7-eabi -mcpu=cortex-a17 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A17-ALLOW-FP-INSTR %s |
| 453 | // RUN: %clang -target armv7-eabi -mthumb -mcpu=cortex-a17 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=A17-ALLOW-FP-INSTR %s |
| 454 | // A17-ALLOW-FP-INSTR:#define __ARM_ARCH 7 |
| 455 | // A17-ALLOW-FP-INSTR:#define __ARM_ARCH_7A__ 1 |
| 456 | // A17-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1 |
| 457 | // A17-ALLOW-FP-INSTR:#define __ARM_ARCH_PROFILE 'A' |
| 458 | // A17-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1 |
| 459 | // A17-ALLOW-FP-INSTR:#define __ARM_FP 0xe |
| 460 | |
| 461 | // Test whether predefines are as expected when targeting swift (soft FP ABI as default). |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 462 | // RUN: %clang -target armv7s -mcpu=swift -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=SWIFT %s |
| 463 | // RUN: %clang -target armv7s -mthumb -mcpu=swift -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=SWIFT %s |
Artyom Skrobov | 59f43bb | 2016-03-23 13:32:33 +0000 | [diff] [blame] | 464 | // SWIFT:#define __ARM_ARCH_EXT_IDIV__ 1 |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 465 | // SWIFT:#define __ARM_FEATURE_DSP 1 |
Keith Walker | 167961f | 2018-02-19 12:40:26 +0000 | [diff] [blame] | 466 | // SWIFT-NOT:#define __ARM_FP 0xxE |
Silviu Baranga | e569046 | 2013-10-21 10:59:33 +0000 | [diff] [blame] | 467 | |
Keith Walker | 167961f | 2018-02-19 12:40:26 +0000 | [diff] [blame] | 468 | // Test whether predefines are as expected when targeting swift (softfp FP ABI as default). |
| 469 | // RUN: %clang -target armv7s-eabi -mcpu=swift -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=SWIFT-ALLOW-FP-INSTR %s |
| 470 | // RUN: %clang -target armv7s-eabi -mthumb -mcpu=swift -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=SWIFT-ALLOW-FP-INSTR %s |
| 471 | // SWIFT-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1 |
| 472 | // SWIFT-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1 |
| 473 | // SWIFT-ALLOW-FP-INSTR:#define __ARM_FP 0xe |
| 474 | |
| 475 | // Test whether predefines are as expected when targeting ARMv8-A Cortex implementations (soft FP ABI as default) |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 476 | // RUN: %clang -target armv8 -mcpu=cortex-a32 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s |
| 477 | // RUN: %clang -target armv8 -mthumb -mcpu=cortex-a32 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s |
Sjoerd Meijer | b3b8147 | 2016-06-03 08:47:56 +0000 | [diff] [blame] | 478 | // RUN: %clang -target armv8 -mcpu=cortex-a35 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s |
| 479 | // RUN: %clang -target armv8 -mthumb -mcpu=cortex-a35 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 480 | // RUN: %clang -target armv8 -mcpu=cortex-a53 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s |
| 481 | // RUN: %clang -target armv8 -mthumb -mcpu=cortex-a53 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s |
Sjoerd Meijer | b3b8147 | 2016-06-03 08:47:56 +0000 | [diff] [blame] | 482 | // RUN: %clang -target armv8 -mcpu=cortex-a57 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s |
| 483 | // RUN: %clang -target armv8 -mthumb -mcpu=cortex-a57 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s |
| 484 | // RUN: %clang -target armv8 -mcpu=cortex-a72 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s |
| 485 | // RUN: %clang -target armv8 -mthumb -mcpu=cortex-a72 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s |
Sjoerd Meijer | 90df4a7 | 2016-06-02 10:48:37 +0000 | [diff] [blame] | 486 | // RUN: %clang -target armv8 -mcpu=cortex-a73 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s |
| 487 | // RUN: %clang -target armv8 -mthumb -mcpu=cortex-a73 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s |
Artyom Skrobov | 59f43bb | 2016-03-23 13:32:33 +0000 | [diff] [blame] | 488 | // ARMV8:#define __ARM_ARCH_EXT_IDIV__ 1 |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 489 | // ARMV8:#define __ARM_FEATURE_DSP 1 |
Keith Walker | 167961f | 2018-02-19 12:40:26 +0000 | [diff] [blame] | 490 | // ARMV8-NOT:#define __ARM_FP 0x |
| 491 | |
| 492 | // Test whether predefines are as expected when targeting ARMv8-A Cortex implementations (softfp FP ABI as default) |
| 493 | // 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 |
| 494 | // 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 |
| 495 | // 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 |
| 496 | // 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 |
| 497 | // 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 |
| 498 | // 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 |
| 499 | // 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 |
| 500 | // 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 |
| 501 | // 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 |
| 502 | // 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 |
| 503 | // 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 |
| 504 | // 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 |
| 505 | // ARMV8-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1 |
| 506 | // ARMV8-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1 |
| 507 | // ARMV8-ALLOW-FP-INSTR:#define __ARM_FP 0xe |
Silviu Baranga | e569046 | 2013-10-21 10:59:33 +0000 | [diff] [blame] | 508 | |
Javed Absar | 879d18b8 | 2015-04-09 14:12:10 +0000 | [diff] [blame] | 509 | // Test whether predefines are as expected when targeting cortex-r4. |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 510 | // RUN: %clang -target armv7 -mcpu=cortex-r4 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R4-ARM %s |
Javed Absar | 879d18b8 | 2015-04-09 14:12:10 +0000 | [diff] [blame] | 511 | // R4-ARM-NOT:#define __ARM_ARCH_EXT_IDIV__ |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 512 | // R4-ARM:#define __ARM_FEATURE_DSP 1 |
Richard Barton | 7dacc24 | 2015-10-21 10:03:55 +0000 | [diff] [blame] | 513 | // R4-ARM-NOT:#define __ARM_FP 0x{{.*}} |
Javed Absar | 879d18b8 | 2015-04-09 14:12:10 +0000 | [diff] [blame] | 514 | |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 515 | // RUN: %clang -target armv7 -mthumb -mcpu=cortex-r4 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R4-THUMB %s |
Javed Absar | 879d18b8 | 2015-04-09 14:12:10 +0000 | [diff] [blame] | 516 | // R4-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1 |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 517 | // R4-THUMB:#define __ARM_FEATURE_DSP 1 |
Richard Barton | 7dacc24 | 2015-10-21 10:03:55 +0000 | [diff] [blame] | 518 | // R4-THUMB-NOT:#define __ARM_FP 0x{{.*}} |
Javed Absar | 879d18b8 | 2015-04-09 14:12:10 +0000 | [diff] [blame] | 519 | |
Keith Walker | 167961f | 2018-02-19 12:40:26 +0000 | [diff] [blame] | 520 | // Test whether predefines are as expected when targeting cortex-r4f (soft FP ABI as default). |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 521 | // RUN: %clang -target armv7 -mcpu=cortex-r4f -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R4F-ARM %s |
Javed Absar | 879d18b8 | 2015-04-09 14:12:10 +0000 | [diff] [blame] | 522 | // R4F-ARM-NOT:#define __ARM_ARCH_EXT_IDIV__ |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 523 | // R4F-ARM:#define __ARM_FEATURE_DSP 1 |
Keith Walker | 167961f | 2018-02-19 12:40:26 +0000 | [diff] [blame] | 524 | // R4F-ARM-NOT:#define __ARM_FP 0x |
| 525 | |
| 526 | // Test whether predefines are as expected when targeting cortex-r4f (softfp FP ABI as default). |
| 527 | // 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 |
| 528 | // R4F-ARM-ALLOW-FP-INSTR-NOT:#define __ARM_ARCH_EXT_IDIV__ |
| 529 | // R4F-ARM-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1 |
| 530 | // R4F-ARM-ALLOW-FP-INSTR:#define __ARM_FP 0xc |
Javed Absar | 879d18b8 | 2015-04-09 14:12:10 +0000 | [diff] [blame] | 531 | |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 532 | // RUN: %clang -target armv7 -mthumb -mcpu=cortex-r4f -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R4F-THUMB %s |
Artyom Skrobov | 59f43bb | 2016-03-23 13:32:33 +0000 | [diff] [blame] | 533 | // R4F-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1 |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 534 | // R4F-THUMB:#define __ARM_FEATURE_DSP 1 |
Keith Walker | 167961f | 2018-02-19 12:40:26 +0000 | [diff] [blame] | 535 | // R4F-THUMB-NOT:#define __ARM_FP 0x |
Javed Absar | 879d18b8 | 2015-04-09 14:12:10 +0000 | [diff] [blame] | 536 | |
Keith Walker | 167961f | 2018-02-19 12:40:26 +0000 | [diff] [blame] | 537 | // 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 |
| 538 | // R4F-THUMB-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1 |
| 539 | // R4F-THUMB-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1 |
| 540 | // R4F-THUMB-ALLOW-FP-INSTR:#define __ARM_FP 0xc |
| 541 | |
| 542 | // Test whether predefines are as expected when targeting cortex-r5 (soft FP ABI as default). |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 543 | // RUN: %clang -target armv7 -mcpu=cortex-r5 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R5 %s |
| 544 | // RUN: %clang -target armv7 -mthumb -mcpu=cortex-r5 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R5 %s |
Artyom Skrobov | 59f43bb | 2016-03-23 13:32:33 +0000 | [diff] [blame] | 545 | // R5:#define __ARM_ARCH_EXT_IDIV__ 1 |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 546 | // R5:#define __ARM_FEATURE_DSP 1 |
Keith Walker | 167961f | 2018-02-19 12:40:26 +0000 | [diff] [blame] | 547 | // R5-NOT:#define __ARM_FP 0x |
Silviu Baranga | e569046 | 2013-10-21 10:59:33 +0000 | [diff] [blame] | 548 | |
Keith Walker | 167961f | 2018-02-19 12:40:26 +0000 | [diff] [blame] | 549 | // Test whether predefines are as expected when targeting cortex-r5 (softfp FP ABI as default). |
| 550 | // 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 |
| 551 | // 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 |
| 552 | // R5-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1 |
| 553 | // R5-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1 |
| 554 | // R5-ALLOW-FP-INSTR:#define __ARM_FP 0xc |
| 555 | |
| 556 | // Test whether predefines are as expected when targeting cortex-r7 and cortex-r8 (soft FP ABI as default). |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 557 | // RUN: %clang -target armv7 -mcpu=cortex-r7 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R7-R8 %s |
| 558 | // RUN: %clang -target armv7 -mthumb -mcpu=cortex-r7 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R7-R8 %s |
| 559 | // RUN: %clang -target armv7 -mcpu=cortex-r8 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R7-R8 %s |
| 560 | // RUN: %clang -target armv7 -mthumb -mcpu=cortex-r8 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=R7-R8 %s |
Artyom Skrobov | 59f43bb | 2016-03-23 13:32:33 +0000 | [diff] [blame] | 561 | // R7-R8:#define __ARM_ARCH_EXT_IDIV__ 1 |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 562 | // R7-R8:#define __ARM_FEATURE_DSP 1 |
Keith Walker | 167961f | 2018-02-19 12:40:26 +0000 | [diff] [blame] | 563 | // R7-R8-NOT:#define __ARM_FP 0x |
| 564 | |
| 565 | // Test whether predefines are as expected when targeting cortex-r7 and cortex-r8 (softfp FP ABI as default). |
| 566 | // 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 |
| 567 | // 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 |
| 568 | // 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 |
| 569 | // 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 |
| 570 | // R7-R8-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1 |
| 571 | // R7-R8-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1 |
| 572 | // R7-R8-ALLOW-FP-INSTR:#define __ARM_FP 0xe |
Bradley Smith | d86d670 | 2015-02-18 10:34:48 +0000 | [diff] [blame] | 573 | |
Silviu Baranga | e569046 | 2013-10-21 10:59:33 +0000 | [diff] [blame] | 574 | // Test whether predefines are as expected when targeting cortex-m0. |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 575 | // RUN: %clang -target armv7 -mthumb -mcpu=cortex-m0 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M0-THUMB %s |
| 576 | // RUN: %clang -target armv7 -mthumb -mcpu=cortex-m0plus -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M0-THUMB %s |
| 577 | // RUN: %clang -target armv7 -mthumb -mcpu=cortex-m1 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M0-THUMB %s |
| 578 | // RUN: %clang -target armv7 -mthumb -mcpu=sc000 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M0-THUMB %s |
Silviu Baranga | e569046 | 2013-10-21 10:59:33 +0000 | [diff] [blame] | 579 | // M0-THUMB-NOT:#define __ARM_ARCH_EXT_IDIV__ |
Sergey Dmitrouk | 745f530 | 2014-11-25 08:57:36 +0000 | [diff] [blame] | 580 | // M0-THUMB-NOT:#define __ARM_FEATURE_DSP |
Richard Barton | 7dacc24 | 2015-10-21 10:03:55 +0000 | [diff] [blame] | 581 | // M0-THUMB-NOT:#define __ARM_FP 0x{{.*}} |
Silviu Baranga | e569046 | 2013-10-21 10:59:33 +0000 | [diff] [blame] | 582 | |
| 583 | // Test whether predefines are as expected when targeting cortex-m3. |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 584 | // RUN: %clang -target armv7 -mthumb -mcpu=cortex-m3 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M3-THUMB %s |
| 585 | // RUN: %clang -target armv7 -mthumb -mcpu=sc300 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M3-THUMB %s |
Silviu Baranga | e569046 | 2013-10-21 10:59:33 +0000 | [diff] [blame] | 586 | // M3-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1 |
Sergey Dmitrouk | 745f530 | 2014-11-25 08:57:36 +0000 | [diff] [blame] | 587 | // M3-THUMB-NOT:#define __ARM_FEATURE_DSP |
Richard Barton | 7dacc24 | 2015-10-21 10:03:55 +0000 | [diff] [blame] | 588 | // M3-THUMB-NOT:#define __ARM_FP 0x{{.*}} |
Silviu Baranga | e569046 | 2013-10-21 10:59:33 +0000 | [diff] [blame] | 589 | |
Keith Walker | 167961f | 2018-02-19 12:40:26 +0000 | [diff] [blame] | 590 | // Test whether predefines are as expected when targeting cortex-m4 (soft FP ABI as default). |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 591 | // RUN: %clang -target armv7 -mthumb -mcpu=cortex-m4 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M4-THUMB %s |
Silviu Baranga | e569046 | 2013-10-21 10:59:33 +0000 | [diff] [blame] | 592 | // M4-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1 |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 593 | // M4-THUMB:#define __ARM_FEATURE_DSP 1 |
Keith Walker | 167961f | 2018-02-19 12:40:26 +0000 | [diff] [blame] | 594 | // M4-THUMB-NOT:#define __ARM_FP 0x |
Ana Pazos | dd6068d | 2013-12-06 22:43:17 +0000 | [diff] [blame] | 595 | |
Keith Walker | 167961f | 2018-02-19 12:40:26 +0000 | [diff] [blame] | 596 | // Test whether predefines are as expected when targeting cortex-m4 (softfp ABI as default). |
| 597 | // 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 |
| 598 | // M4-THUMB-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1 |
| 599 | // M4-THUMB-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1 |
| 600 | // M4-THUMB-ALLOW-FP-INSTR:#define __ARM_FP 0x6 |
| 601 | |
| 602 | // Test whether predefines are as expected when targeting cortex-m7 (soft FP ABI as default). |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 603 | // RUN: %clang -target armv7 -mthumb -mcpu=cortex-m7 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M7-THUMB %s |
Oliver Stannard | bfd3ea3 | 2014-10-01 09:03:02 +0000 | [diff] [blame] | 604 | // M7-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1 |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 605 | // M7-THUMB:#define __ARM_FEATURE_DSP 1 |
Keith Walker | 167961f | 2018-02-19 12:40:26 +0000 | [diff] [blame] | 606 | // M7-THUMB-NOT:#define __ARM_FP 0x |
| 607 | // M7-THUMB-NOT:#define __ARM_FPV5__ |
| 608 | |
| 609 | // Test whether predefines are as expected when targeting cortex-m7 (softfp FP ABI as default). |
| 610 | // 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 |
| 611 | // M7-THUMB-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1 |
| 612 | // M7-THUMB-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1 |
| 613 | // M7-THUMB-ALLOW-FP-INSTR:#define __ARM_FP 0xe |
| 614 | // M7-THUMB-ALLOW-FP-INSTR:#define __ARM_FPV5__ 1 |
Oliver Stannard | bfd3ea3 | 2014-10-01 09:03:02 +0000 | [diff] [blame] | 615 | |
Sanne Wouda | 0479e69 | 2017-02-20 10:37:01 +0000 | [diff] [blame] | 616 | // Test whether predefines are as expected when targeting v8m cores |
| 617 | // RUN: %clang -target arm -mcpu=cortex-m23 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M23 %s |
| 618 | // M23: #define __ARM_ARCH 8 |
| 619 | // M23: #define __ARM_ARCH_8M_BASE__ 1 |
| 620 | // M23: #define __ARM_ARCH_EXT_IDIV__ 1 |
| 621 | // M23-NOT: __ARM_ARCH_ISA_ARM |
| 622 | // M23: #define __ARM_ARCH_ISA_THUMB 1 |
| 623 | // M23: #define __ARM_ARCH_PROFILE 'M' |
| 624 | // M23-NOT: __ARM_FEATURE_CRC32 |
| 625 | // M23-NOT: __ARM_FEATURE_DSP |
| 626 | // M23-NOT: __ARM_FP 0x{{.*}} |
| 627 | // M23-NOT: __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 |
| 628 | |
Keith Walker | 167961f | 2018-02-19 12:40:26 +0000 | [diff] [blame] | 629 | // Test whether predefines are as expected when targeting m33 (soft FP ABI as default). |
Sanne Wouda | 0479e69 | 2017-02-20 10:37:01 +0000 | [diff] [blame] | 630 | // RUN: %clang -target arm -mcpu=cortex-m33 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=M33 %s |
| 631 | // M33: #define __ARM_ARCH 8 |
| 632 | // M33: #define __ARM_ARCH_8M_MAIN__ 1 |
| 633 | // M33: #define __ARM_ARCH_EXT_IDIV__ 1 |
| 634 | // M33-NOT: __ARM_ARCH_ISA_ARM |
| 635 | // M33: #define __ARM_ARCH_ISA_THUMB 2 |
| 636 | // M33: #define __ARM_ARCH_PROFILE 'M' |
| 637 | // M33-NOT: __ARM_FEATURE_CRC32 |
| 638 | // M33: #define __ARM_FEATURE_DSP 1 |
Keith Walker | 167961f | 2018-02-19 12:40:26 +0000 | [diff] [blame] | 639 | // M33-NOT: #define __ARM_FP 0x |
Sanne Wouda | 0479e69 | 2017-02-20 10:37:01 +0000 | [diff] [blame] | 640 | // M33: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1 |
| 641 | |
Keith Walker | 167961f | 2018-02-19 12:40:26 +0000 | [diff] [blame] | 642 | // Test whether predefines are as expected when targeting m33 (softfp FP ABI as default). |
| 643 | // 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 |
| 644 | // M33-ALLOW-FP-INSTR: #define __ARM_ARCH 8 |
| 645 | // M33-ALLOW-FP-INSTR: #define __ARM_ARCH_8M_MAIN__ 1 |
| 646 | // M33-ALLOW-FP-INSTR: #define __ARM_ARCH_EXT_IDIV__ 1 |
| 647 | // M33-ALLOW-FP-INSTR-NOT: __ARM_ARCH_ISA_ARM |
| 648 | // M33-ALLOW-FP-INSTR: #define __ARM_ARCH_ISA_THUMB 2 |
| 649 | // M33-ALLOW-FP-INSTR: #define __ARM_ARCH_PROFILE 'M' |
| 650 | // M33-ALLOW-FP-INSTR-NOT: __ARM_FEATURE_CRC32 |
| 651 | // M33-ALLOW-FP-INSTR: #define __ARM_FEATURE_DSP 1 |
| 652 | // M33-ALLOW-FP-INSTR: #define __ARM_FP 0x6 |
| 653 | // M33-ALLOW-FP-INSTR: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1 |
| 654 | |
| 655 | // Test whether predefines are as expected when targeting krait (soft FP as default). |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 656 | // RUN: %clang -target armv7 -mcpu=krait -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=KRAIT %s |
| 657 | // RUN: %clang -target armv7 -mthumb -mcpu=krait -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=KRAIT %s |
Artyom Skrobov | 59f43bb | 2016-03-23 13:32:33 +0000 | [diff] [blame] | 658 | // KRAIT:#define __ARM_ARCH_EXT_IDIV__ 1 |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 659 | // KRAIT:#define __ARM_FEATURE_DSP 1 |
Keith Walker | 167961f | 2018-02-19 12:40:26 +0000 | [diff] [blame] | 660 | // KRAIT-NOT:#define __ARM_VFPV4__ |
| 661 | |
| 662 | // Test whether predefines are as expected when targeting krait (softfp FP as default). |
| 663 | // RUN: %clang -target armv7-eabi -mcpu=krait -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=KRAIT-ALLOW-FP-INSTR %s |
| 664 | // 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 |
| 665 | // KRAIT-ALLOW-FP-INSTR:#define __ARM_ARCH_EXT_IDIV__ 1 |
| 666 | // KRAIT-ALLOW-FP-INSTR:#define __ARM_FEATURE_DSP 1 |
| 667 | // KRAIT-ALLOW-FP-INSTR:#define __ARM_VFPV4__ 1 |
Vladimir Sukharev | c6dab75 | 2015-05-14 08:25:18 +0000 | [diff] [blame] | 668 | |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 669 | // RUN: %clang -target armv8.1a-none-none-eabi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V81A %s |
| 670 | // CHECK-V81A: #define __ARM_ARCH 8 |
| 671 | // CHECK-V81A: #define __ARM_ARCH_8_1A__ 1 |
Vladimir Sukharev | c6dab75 | 2015-05-14 08:25:18 +0000 | [diff] [blame] | 672 | // CHECK-V81A: #define __ARM_ARCH_PROFILE 'A' |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 673 | // CHECK-V81A: #define __ARM_FEATURE_QRDMX 1 |
Benjamin Kramer | 3a13ed6 | 2017-12-28 16:58:54 +0000 | [diff] [blame] | 674 | // CHECK-V81A: #define __ARM_FP 0xe |
Oliver Stannard | 3086c04 | 2016-02-11 16:05:52 +0000 | [diff] [blame] | 675 | |
James Y Knight | 3508b22 | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 676 | // RUN: %clang -target armv8.2a-none-none-eabi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V82A %s |
| 677 | // CHECK-V82A: #define __ARM_ARCH 8 |
| 678 | // CHECK-V82A: #define __ARM_ARCH_8_2A__ 1 |
Oliver Stannard | 3086c04 | 2016-02-11 16:05:52 +0000 | [diff] [blame] | 679 | // CHECK-V82A: #define __ARM_ARCH_PROFILE 'A' |
Sjoerd Meijer | cb75f61 | 2017-06-30 08:07:34 +0000 | [diff] [blame] | 680 | // CHECK-V82A: #define __ARM_FEATURE_QRDMX 1 |
Benjamin Kramer | 3a13ed6 | 2017-12-28 16:58:54 +0000 | [diff] [blame] | 681 | // CHECK-V82A: #define __ARM_FP 0xe |