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