1 // RUN: %clang -target arm-eabi -x c -E -dM %s -o - | FileCheck %s 2 // RUN: %clang -target thumb-eabi -x c -E -dM %s -o - | FileCheck %s 3 4 // CHECK-NOT: __ARM_64BIT_STATE 5 // CHECK-NOT: __ARM_ARCH_ISA_A64 6 // CHECK-NOT: __ARM_BIG_ENDIAN 7 // CHECK: __ARM_32BIT_STATE 1 8 // CHECK: __ARM_ACLE 200 9 10 // RUN: %clang -target armeb-eabi -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-BIGENDIAN 11 // RUN: %clang -target thumbeb-eabi -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-BIGENDIAN 12 13 // CHECK-BIGENDIAN: __ARM_BIG_ENDIAN 1 14 15 // RUN: %clang -target armv7-none-linux-eabi -mno-unaligned-access -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-UNALIGNED 16 17 // CHECK-UNALIGNED-NOT: __ARM_FEATURE_UNALIGNED 18 19 // RUN: %clang -target arm-none-linux-eabi -march=armv4 -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-V4 20 21 // CHECK-V4-NOT: __ARM_ARCH_ISA_THUMB 22 // CHECK-V4-NOT: __ARM_ARCH_PROFILE 23 // CHECK-V4-NOT: __ARM_FEATURE_CLZ 24 // CHECK-V4-NOT: __ARM_FEATURE_LDREX 25 // CHECK-V4-NOT: __ARM_FEATURE_UNALIGNED 26 // CHECK-V4-NOT: __ARM_FEATURE_DSP 27 // CHECK-V4-NOT: __ARM_FEATURE_SAT 28 // CHECK-V4-NOT: __ARM_FEATURE_QBIT 29 // CHECK-V4-NOT: __ARM_FEATURE_SIMD32 30 // CHECK-V4-NOT: __ARM_FEATURE_IDIV 31 // CHECK-V4: __ARM_ARCH 4 32 // CHECK-V4: __ARM_ARCH_ISA_ARM 1 33 34 // RUN: %clang -target arm-none-linux-eabi -march=armv4t -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-V4T 35 36 // CHECK-V4T: __ARM_ARCH_ISA_THUMB 1 37 38 // RUN: %clang -target arm-none-linux-eabi -march=armv5t -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-V5 39 40 // CHECK-V5-NOT: __ARM_ARCH_PROFILE 41 // CHECK-V5-NOT: __ARM_FEATURE_LDREX 42 // CHECK-V5-NOT: __ARM_FEATURE_UNALIGNED 43 // CHECK-V5-NOT: __ARM_FEATURE_DSP 44 // CHECK-V5-NOT: __ARM_FEATURE_SAT 45 // CHECK-V5-NOT: __ARM_FEATURE_QBIT 46 // CHECK-V5-NOT: __ARM_FEATURE_SIMD32 47 // CHECK-V5-NOT: __ARM_FEATURE_IDIV 48 // CHECK-V5: __ARM_ARCH 5 49 // CHECK-V5: __ARM_ARCH_ISA_ARM 1 50 // CHECK-V5: __ARM_ARCH_ISA_THUMB 1 51 // CHECK-V5: __ARM_FEATURE_CLZ 1 52 53 // RUN: %clang -target arm-none-linux-eabi -march=armv5te -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-V5E 54 55 // CHECK-V5E: __ARM_FEATURE_DSP 1 56 // CHECK-V5E: __ARM_FEATURE_QBIT 1 57 58 // RUN: %clang -target armv6-none-netbsd-eabi -mcpu=arm1136jf-s -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-V6 59 60 // CHECK-V6-NOT: __ARM_ARCH_PROFILE 61 // CHECK-V6-NOT: __ARM_FEATURE_IDIV 62 // CHECK-V6: __ARM_ARCH 6 63 // CHECK-V6: __ARM_ARCH_ISA_ARM 1 64 // CHECK-V6: __ARM_ARCH_ISA_THUMB 1 65 // CHECK-V6: __ARM_FEATURE_CLZ 1 66 // CHECK-V6: __ARM_FEATURE_DSP 1 67 // CHECK-V6: __ARM_FEATURE_LDREX 0x4 68 // CHECK-V6: __ARM_FEATURE_QBIT 1 69 // CHECK-V6: __ARM_FEATURE_SAT 1 70 // CHECK-V6: __ARM_FEATURE_SIMD32 1 71 // CHECK-V6: __ARM_FEATURE_UNALIGNED 1 72 73 // RUN: %clang -target arm-none-linux-eabi -march=armv6m -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-V6M 74 75 // CHECK-V6M-NOT: __ARM_ARCH_ISA_ARM 76 // CHECK-V6M-NOT: __ARM_FEATURE_CLZ 77 // CHECK-V6M-NOT: __ARM_FEATURE_LDREX 78 // CHECK-V6M-NOT: __ARM_FEATURE_UNALIGNED 79 // CHECK-V6M-NOT: __ARM_FEATURE_DSP 80 // CHECK-V6M-NOT: __ARM_FEATURE_QBIT 81 // CHECK-V6M-NOT: __ARM_FEATURE_SAT 82 // CHECK-V6M-NOT: __ARM_FEATURE_SIMD32 83 // CHECK-V6M-NOT: __ARM_FEATURE_IDIV 84 // CHECK-V6M: __ARM_ARCH 6 85 // CHECK-V6M: __ARM_ARCH_ISA_THUMB 1 86 // CHECK-V6M: __ARM_ARCH_PROFILE 'M' 87 88 // RUN: %clang -target arm-none-linux-eabi -march=armv6t2 -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-V6T2 89 90 // CHECK-V6T2: __ARM_ARCH_ISA_THUMB 2 91 92 // RUN: %clang -target arm-none-linux-eabi -march=armv6k -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-V6K 93 94 // CHECK-V6K: __ARM_FEATURE_LDREX 0xF 95 96 // RUN: %clang -target arm-none-linux-eabi -march=armv7-a -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-V7A 97 98 // CHECK-V7A: __ARM_ARCH 7 99 // CHECK-V7A: __ARM_ARCH_ISA_ARM 1 100 // CHECK-V7A: __ARM_ARCH_ISA_THUMB 2 101 // CHECK-V7A: __ARM_ARCH_PROFILE 'A' 102 // CHECK-V7A: __ARM_FEATURE_CLZ 1 103 // CHECK-V7A: __ARM_FEATURE_DSP 1 104 // CHECK-V7A: __ARM_FEATURE_LDREX 0xF 105 // CHECK-V7A: __ARM_FEATURE_QBIT 1 106 // CHECK-V7A: __ARM_FEATURE_SAT 1 107 // CHECK-V7A: __ARM_FEATURE_SIMD32 1 108 // CHECK-V7A: __ARM_FEATURE_UNALIGNED 1 109 110 // RUN: %clang -target arm-none-linux-eabi -mcpu=cortex-a7 -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-V7A-IDIV 111 // RUN: %clang -target arm-none-linux-eabi -mcpu=cortex-a12 -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-V7A-IDIV 112 // RUN: %clang -target arm-none-linux-eabi -mcpu=cortex-a15 -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-V7A-IDIV 113 // RUN: %clang -target arm-none-linux-eabi -mcpu=cortex-a17 -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-V7A-IDIV 114 115 // CHECK-V7A-IDIV: __ARM_FEATURE_IDIV 1 116 117 // RUN: %clang -target arm-none-linux-eabi -mcpu=cortex-a5 -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-V7A-NO-IDIV 118 // RUN: %clang -target arm-none-linux-eabi -mcpu=cortex-a8 -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-V7A-NO-IDIV 119 // RUN: %clang -target arm-none-linux-eabi -mcpu=cortex-a9 -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-V7A-NO-IDIV 120 121 // CHECK-V7A-NO-IDIV-NOT: __ARM_FEATURE_IDIV 122 123 // RUN: %clang -target arm-none-linux-eabi -march=armv7-r -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-V7R 124 125 // CHECK-V7R: __ARM_ARCH 7 126 // CHECK-V7R: __ARM_ARCH_ISA_ARM 1 127 // CHECK-V7R: __ARM_ARCH_ISA_THUMB 2 128 // CHECK-V7R: __ARM_ARCH_PROFILE 'R' 129 // CHECK-V7R: __ARM_FEATURE_CLZ 1 130 // CHECK-V7R: __ARM_FEATURE_DSP 1 131 // CHECK-V7R: __ARM_FEATURE_LDREX 0xF 132 // CHECK-V7R: __ARM_FEATURE_QBIT 1 133 // CHECK-V7R: __ARM_FEATURE_SAT 1 134 // CHECK-V7R: __ARM_FEATURE_SIMD32 1 135 // CHECK-V7R: __ARM_FEATURE_UNALIGNED 1 136 137 // RUN: %clang -target arm-none-linux-eabi -mcpu=cortex-r4 -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-V7R-NO-IDIV 138 139 // CHECK-V7R-NO-IDIV-NOT: __ARM_FEATURE_IDIV 140 141 // RUN: %clang -target arm-none-linux-eabi -mcpu=cortex-r5 -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-V7R-IDIV 142 // RUN: %clang -target arm-none-linux-eabi -mcpu=cortex-r7 -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-V7R-IDIV 143 // RUN: %clang -target arm-none-linux-eabi -mcpu=cortex-r8 -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-V7R-IDIV 144 145 // CHECK-V7R-IDIV: __ARM_FEATURE_IDIV 1 146 147 // RUN: %clang -target arm-none-linux-eabi -march=armv7-m -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-V7M 148 149 // CHECK-V7M-NOT: __ARM_ARCH_ISA_ARM 150 // CHECK-V7M-NOT: __ARM_FEATURE_DSP 151 // CHECK-V7M-NOT: __ARM_FEATURE_SIMD32 152 // CHECK-V7M: __ARM_ARCH 7 153 // CHECK-V7M: __ARM_ARCH_ISA_THUMB 2 154 // CHECK-V7M: __ARM_ARCH_PROFILE 'M' 155 // CHECK-V7M: __ARM_FEATURE_CLZ 1 156 // CHECK-V7M: __ARM_FEATURE_IDIV 1 157 // CHECK-V7M: __ARM_FEATURE_LDREX 0x7 158 // CHECK-V7M: __ARM_FEATURE_QBIT 1 159 // CHECK-V7M: __ARM_FEATURE_SAT 1 160 // CHECK-V7M: __ARM_FEATURE_UNALIGNED 1 161 162 // RUN: %clang -target arm-none-linux-eabi -march=armv7e-m -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-V7EM 163 164 // CHECK-V7EM: __ARM_FEATURE_DSP 1 165 // CHECK-V7EM: __ARM_FEATURE_SIMD32 1 166 167 // RUN: %clang -target arm-none-linux-eabi -march=armv8-a -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-V8A 168 169 // CHECK-V8A: __ARM_ARCH 8 170 // CHECK-V8A: __ARM_ARCH_ISA_ARM 1 171 // CHECK-V8A: __ARM_ARCH_ISA_THUMB 2 172 // CHECK-V8A: __ARM_ARCH_PROFILE 'A' 173 // CHECK-V8A: __ARM_FEATURE_CLZ 1 174 // CHECK-V8A: __ARM_FEATURE_DSP 1 175 // CHECK-V8A: __ARM_FEATURE_IDIV 1 176 // CHECK-V8A: __ARM_FEATURE_LDREX 0xF 177 // CHECK-V8A: __ARM_FEATURE_QBIT 1 178 // CHECK-V8A: __ARM_FEATURE_SAT 1 179 // CHECK-V8A: __ARM_FEATURE_SIMD32 1 180 // CHECK-V8A: __ARM_FEATURE_UNALIGNED 1 181 182