Home | History | Annotate | Download | only in Preprocessor
      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 
    144 // CHECK-V7R-IDIV: __ARM_FEATURE_IDIV 1
    145 
    146 // RUN: %clang -target arm-none-linux-eabi -march=armv7-m -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-V7M
    147 
    148 // CHECK-V7M-NOT: __ARM_ARCH_ISA_ARM
    149 // CHECK-V7M-NOT: __ARM_FEATURE_DSP
    150 // CHECK-V7M-NOT: __ARM_FEATURE_SIMD32
    151 // CHECK-V7M:     __ARM_ARCH 7
    152 // CHECK-V7M:     __ARM_ARCH_ISA_THUMB 2
    153 // CHECK-V7M:     __ARM_ARCH_PROFILE 'M'
    154 // CHECK-V7M:     __ARM_FEATURE_CLZ 1
    155 // CHECK-V7M:     __ARM_FEATURE_IDIV 1
    156 // CHECK-V7M:     __ARM_FEATURE_LDREX 0x7
    157 // CHECK-V7M:     __ARM_FEATURE_QBIT 1
    158 // CHECK-V7M:     __ARM_FEATURE_SAT 1
    159 // CHECK-V7M:     __ARM_FEATURE_UNALIGNED 1
    160 
    161 // RUN: %clang -target arm-none-linux-eabi -march=armv7e-m -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-V7EM
    162 
    163 // CHECK-V7EM: __ARM_FEATURE_DSP 1
    164 // CHECK-V7EM: __ARM_FEATURE_SIMD32 1
    165 
    166 // RUN: %clang -target arm-none-linux-eabi -march=armv8-a -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-V8A
    167 
    168 // CHECK-V8A: __ARM_ARCH 8
    169 // CHECK-V8A: __ARM_ARCH_ISA_ARM 1
    170 // CHECK-V8A: __ARM_ARCH_ISA_THUMB 2
    171 // CHECK-V8A: __ARM_ARCH_PROFILE 'A'
    172 // CHECK-V8A: __ARM_FEATURE_CLZ 1
    173 // CHECK-V8A: __ARM_FEATURE_DSP 1
    174 // CHECK-V8A: __ARM_FEATURE_IDIV 1
    175 // CHECK-V8A: __ARM_FEATURE_LDREX 0xF
    176 // CHECK-V8A: __ARM_FEATURE_QBIT 1
    177 // CHECK-V8A: __ARM_FEATURE_SAT 1
    178 // CHECK-V8A: __ARM_FEATURE_SIMD32 1
    179 // CHECK-V8A: __ARM_FEATURE_UNALIGNED 1
    180 
    181