Home | History | Annotate | Download | only in Preprocessor
      1 // RUN: %clang -target armv8a-none-linux-gnu -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-V8A %s
      2 // CHECK-V8A: __ARMEL__ 1
      3 // CHECK-V8A: __ARM_ARCH 8
      4 // CHECK-V8A: __ARM_ARCH_8A__ 1
      5 // CHECK-V8A: __ARM_FEATURE_CRC32 1
      6 // CHECK-V8A: __ARM_FEATURE_DIRECTED_ROUNDING 1
      7 // CHECK-V8A: __ARM_FEATURE_NUMERIC_MAXMIN 1
      8 // CHECK-V8A: __ARM_FP 0xE
      9 // CHECK-V8A: __ARM_FP16_ARGS 1
     10 // CHECK-V8A: __ARM_FP16_FORMAT_IEEE 1
     11 
     12 // RUN: %clang -target armv7a-none-linux-gnu -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-V7 %s
     13 // CHECK-V7: __ARMEL__ 1
     14 // CHECK-V7: __ARM_ARCH 7
     15 // CHECK-V7: __ARM_ARCH_7A__ 1
     16 // CHECK-V7-NOT: __ARM_FEATURE_CRC32
     17 // CHECK-V7-NOT: __ARM_FEATURE_NUMERIC_MAXMIN
     18 // CHECK-V7-NOT: __ARM_FEATURE_DIRECTED_ROUNDING
     19 // CHECK-V7: __ARM_FP 0xC
     20 
     21 // RUN: %clang -target x86_64-apple-macosx10.10 -arch armv7s -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-V7S %s
     22 // CHECK-V7S: __ARMEL__ 1
     23 // CHECK-V7S: __ARM_ARCH 7
     24 // CHECK-V7S: __ARM_ARCH_7S__ 1
     25 // CHECK-V7S-NOT: __ARM_FEATURE_CRC32
     26 // CHECK-V7S-NOT: __ARM_FEATURE_NUMERIC_MAXMIN
     27 // CHECK-V7S-NOT: __ARM_FEATURE_DIRECTED_ROUNDING
     28 // CHECK-V7S: __ARM_FP 0xE
     29 
     30 // RUN: %clang -target armv8a -mfloat-abi=hard -x c -E -dM %s | FileCheck --check-prefix=CHECK-V8-BAREHF %s
     31 // CHECK-V8-BAREHF: __ARMEL__ 1
     32 // CHECK-V8-BAREHF: __ARM_ARCH 8
     33 // CHECK-V8-BAREHF: __ARM_ARCH_8A__ 1
     34 // CHECK-V8-BAREHF: __ARM_FEATURE_CRC32 1
     35 // CHECK-V8-BAREHF: __ARM_FEATURE_DIRECTED_ROUNDING 1
     36 // CHECK-V8-BAREHF: __ARM_FEATURE_NUMERIC_MAXMIN 1
     37 // CHECK-V8-BAREHP: __ARM_FP 0xE
     38 // CHECK-V8-BAREHF: __ARM_NEON__ 1
     39 // CHECK-V8-BAREHF: __ARM_PCS_VFP 1
     40 // CHECK-V8-BAREHF: __VFP_FP__ 1
     41 
     42 // RUN: %clang -target armv8a -mfloat-abi=hard -mfpu=fp-armv8 -x c -E -dM %s | FileCheck --check-prefix=CHECK-V8-BAREHF-FP %s
     43 // CHECK-V8-BAREHF-FP-NOT: __ARM_NEON__ 1
     44 // CHECK-V8-BAREHP-FP: __ARM_FP 0xE
     45 // CHECK-V8-BAREHF-FP: __VFP_FP__ 1
     46 
     47 // RUN: %clang -target armv8a -mfloat-abi=hard -mfpu=neon-fp-armv8 -x c -E -dM %s | FileCheck --check-prefix=CHECK-V8-BAREHF-NEON-FP %s
     48 // RUN: %clang -target armv8a -mfloat-abi=hard -mfpu=crypto-neon-fp-armv8 -x c -E -dM %s | FileCheck --check-prefix=CHECK-V8-BAREHF-NEON-FP %s
     49 // CHECK-V8-BAREHP-NEON-FP: __ARM_FP 0xE
     50 // CHECK-V8-BAREHF-NEON-FP: __ARM_NEON__ 1
     51 // CHECK-V8-BAREHF-NEON-FP: __VFP_FP__ 1
     52 
     53 // RUN: %clang -target armv8a -mnocrc -x c -E -dM %s | FileCheck --check-prefix=CHECK-V8-NOCRC %s
     54 // CHECK-V8-NOCRC-NOT: __ARM_FEATURE_CRC32 1
     55 
     56 // Check that -mhwdiv works properly for armv8/thumbv8 (enabled by default).
     57 
     58 // RUN: %clang -target armv8 -x c -E -dM %s -o - | FileCheck --check-prefix=ARMV8 %s
     59 // ARMV8:#define __ARM_ARCH_EXT_IDIV__ 1
     60 
     61 // RUN: %clang -target armv8 -mthumb -x c -E -dM %s -o - | FileCheck --check-prefix=THUMBV8 %s
     62 // THUMBV8:#define __ARM_ARCH_EXT_IDIV__ 1
     63 
     64 // RUN: %clang -target armv8-eabi -x c -E -dM %s -o - | FileCheck --check-prefix=ARMV8-EABI %s
     65 // ARMV8-EABI:#define __ARM_ARCH_EXT_IDIV__ 1
     66 
     67 // RUN: %clang -target armv8-eabi -mthumb -x c -E -dM %s -o - | FileCheck --check-prefix=THUMBV8-EABI %s
     68 // THUMBV8-EABI:#define __ARM_ARCH_EXT_IDIV__ 1
     69 
     70 // RUN: %clang -target armv8 -mhwdiv=none -x c -E -dM %s -o - | FileCheck --check-prefix=NONEHWDIV-ARMV8 %s
     71 // NONEHWDIV-ARMV8-NOT:#define __ARM_ARCH_EXT_IDIV__
     72 
     73 // RUN: %clang -target armv8 -mthumb -mhwdiv=none -x c -E -dM %s -o - | FileCheck --check-prefix=NONEHWDIV-THUMBV8 %s
     74 // NONEHWDIV-THUMBV8-NOT:#define __ARM_ARCH_EXT_IDIV__
     75 
     76 // RUN: %clang -target armv8 -mhwdiv=thumb -x c -E -dM %s -o - | FileCheck --check-prefix=THUMBHWDIV-ARMV8 %s
     77 // THUMBHWDIV-ARMV8-NOT:#define __ARM_ARCH_EXT_IDIV__
     78 
     79 // RUN: %clang -target armv8 -mthumb -mhwdiv=arm -x c -E -dM %s -o - | FileCheck --check-prefix=ARMHWDIV-THUMBV8 %s
     80 // ARMHWDIV-THUMBV8-NOT:#define __ARM_ARCH_EXT_IDIV__
     81 
     82 // RUN: %clang -target armv8a -x c -E -dM %s -o - | FileCheck --check-prefix=ARMV8A %s
     83 // ARMV8A:#define __ARM_ARCH_EXT_IDIV__ 1
     84 // ARMV8A: #define __ARM_FP 0xE
     85 
     86 // RUN: %clang -target armv8a -mthumb -x c -E -dM %s -o - | FileCheck --check-prefix=THUMBV8A %s
     87 // THUMBV8A:#define __ARM_ARCH_EXT_IDIV__ 1
     88 // THUMBV8A: #define __ARM_FP 0xE
     89 
     90 // RUN: %clang -target armv8a-eabi -x c -E -dM %s -o - | FileCheck --check-prefix=ARMV8A-EABI %s
     91 // ARMV8A-EABI:#define __ARM_ARCH_EXT_IDIV__ 1
     92 // ARMV8A-EABI: #define __ARM_FP 0xE
     93 
     94 // RUN: %clang -target armv8a-eabi -x c -E -dM %s -o - | FileCheck --check-prefix=THUMBV8A-EABI %s
     95 // THUMBV8A-EABI:#define __ARM_ARCH_EXT_IDIV__ 1
     96 // THUMBV8A-EABI: #define __ARM_FP 0xE
     97 
     98 // RUN: %clang -target arm-none-linux-gnu -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-DEFS %s
     99 // CHECK-DEFS:#define __ARM_PCS 1
    100 // CHECK-DEFS:#define __ARM_SIZEOF_MINIMAL_ENUM 4
    101 // CHECK-DEFS:#define __ARM_SIZEOF_WCHAR_T 4
    102 
    103 // RUN: %clang -target arm-none-linux-gnu -fno-math-errno -fno-signed-zeros\
    104 // RUN:        -fno-trapping-math -fassociative-math -freciprocal-math\
    105 // RUN:        -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-FASTMATH %s
    106 // RUN: %clang -target arm-none-linux-gnu -ffast-math -x c -E -dM %s -o -\
    107 // RUN:        | FileCheck --check-prefix=CHECK-FASTMATH %s
    108 // CHECK-FASTMATH: __ARM_FP_FAST 1
    109 
    110 // RUN: %clang -target arm-none-linux-gnu -fshort-wchar -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-SHORTWCHAR %s
    111 // CHECK-SHORTWCHAR:#define __ARM_SIZEOF_WCHAR_T 2
    112 
    113 // RUN: %clang -target arm-none-linux-gnu -fshort-enums -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-SHORTENUMS %s
    114 // CHECK-SHORTENUMS:#define __ARM_SIZEOF_MINIMAL_ENUM 1
    115 
    116 // Test that -mhwdiv has the right effect for a target CPU which has hwdiv enabled by default.
    117 // RUN: %clang -target armv7 -mcpu=cortex-a15 -x c -E -dM %s -o - | FileCheck --check-prefix=DEFAULTHWDIV-ARM %s
    118 // DEFAULTHWDIV-ARM:#define __ARM_ARCH_EXT_IDIV__ 1
    119 
    120 // RUN: %clang -target armv7 -mthumb -mcpu=cortex-a15 -x c -E -dM %s -o - | FileCheck --check-prefix=DEFAULTHWDIV-THUMB %s
    121 // DEFAULTHWDIV-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
    122 
    123 // RUN: %clang -target armv7 -mcpu=cortex-a15 -mhwdiv=arm -x c -E -dM %s -o - | FileCheck --check-prefix=ARMHWDIV-ARM %s
    124 // ARMHWDIV-ARM:#define __ARM_ARCH_EXT_IDIV__ 1
    125 
    126 // RUN: %clang -target armv7 -mthumb -mcpu=cortex-a15 -mhwdiv=thumb -x c -E -dM %s -o - | FileCheck --check-prefix=THUMBHWDIV-THUMB %s
    127 // THUMBHWDIV-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
    128 
    129 // RUN: %clang -target arm -mcpu=cortex-a15 -mhwdiv=thumb -x c -E -dM %s -o - | FileCheck --check-prefix=DEFAULTHWDIV-THUMBHWDIV-ARM %s
    130 // DEFAULTHWDIV-THUMBHWDIV-ARM-NOT:#define __ARM_ARCH_EXT_IDIV__
    131 
    132 // RUN: %clang -target arm -mthumb -mcpu=cortex-a15 -mhwdiv=arm -x c -E -dM %s -o - | FileCheck --check-prefix=DEFAULTHWDIV-ARMHWDIV-THUMB %s
    133 // DEFAULTHWDIV-ARMHWDIV-THUMB-NOT:#define __ARM_ARCH_EXT_IDIV__
    134 
    135 // RUN: %clang -target arm -mcpu=cortex-a15 -mhwdiv=none -x c -E -dM %s -o - | FileCheck --check-prefix=DEFAULTHWDIV-NONEHWDIV-ARM %s
    136 // DEFAULTHWDIV-NONEHWDIV-ARM-NOT:#define __ARM_ARCH_EXT_IDIV__
    137 
    138 // RUN: %clang -target arm -mthumb -mcpu=cortex-a15 -mhwdiv=none -x c -E -dM %s -o - | FileCheck --check-prefix=DEFAULTHWDIV-NONEHWDIV-THUMB %s
    139 // DEFAULTHWDIV-NONEHWDIV-THUMB-NOT:#define __ARM_ARCH_EXT_IDIV__
    140 
    141 
    142 // Check that -mfpu works properly for Cortex-A7 (enabled by default).
    143 // RUN: %clang -target armv7-none-linux-gnueabi -mcpu=cortex-a7 -x c -E -dM %s -o - | FileCheck --check-prefix=DEFAULTFPU-A7 %s
    144 // RUN: %clang -target armv7-none-linux-gnueabi -mthumb -mcpu=cortex-a7 -x c -E -dM %s -o - | FileCheck --check-prefix=DEFAULTFPU-A7 %s
    145 // DEFAULTFPU-A7:#define __ARM_FP 0xE
    146 // DEFAULTFPU-A7:#define __ARM_NEON__ 1
    147 // DEFAULTFPU-A7:#define __ARM_VFPV4__ 1
    148 
    149 // RUN: %clang -target armv7-none-linux-gnueabi -mcpu=cortex-a7 -mfpu=none -x c -E -dM %s -o - | FileCheck --check-prefix=FPUNONE-A7 %s
    150 // RUN: %clang -target armv7-none-linux-gnueabi -mthumb -mcpu=cortex-a7 -mfpu=none -x c -E -dM %s -o - | FileCheck --check-prefix=FPUNONE-A7 %s
    151 // FPUNONE-A7-NOT:#define __ARM_FP 0x{{.*}}
    152 // FPUNONE-A7-NOT:#define __ARM_NEON__ 1
    153 // FPUNONE-A7-NOT:#define __ARM_VFPV4__ 1
    154 
    155 // RUN: %clang -target armv7-none-linux-gnueabi -mcpu=cortex-a7 -mfpu=vfp4 -x c -E -dM %s -o - | FileCheck --check-prefix=NONEON-A7 %s
    156 // RUN: %clang -target armv7-none-linux-gnueabi -mthumb -mcpu=cortex-a7 -mfpu=vfp4 -x c -E -dM %s -o - | FileCheck --check-prefix=NONEON-A7 %s
    157 // NONEON-A7:#define __ARM_FP 0xE
    158 // NONEON-A7-NOT:#define __ARM_NEON__ 1
    159 // NONEON-A7:#define __ARM_VFPV4__ 1
    160 
    161 // Check that -mfpu works properly for Cortex-A5 (enabled by default).
    162 // RUN: %clang -target armv7-none-linux-gnueabi -mcpu=cortex-a5 -x c -E -dM %s -o - | FileCheck --check-prefix=DEFAULTFPU-A5 %s
    163 // RUN: %clang -target armv7-none-linux-gnueabi -mthumb -mcpu=cortex-a5 -x c -E -dM %s -o - | FileCheck --check-prefix=DEFAULTFPU-A5 %s
    164 // DEFAULTFPU-A5:#define __ARM_FP 0xE
    165 // DEFAULTFPU-A5:#define __ARM_NEON__ 1
    166 // DEFAULTFPU-A5:#define __ARM_VFPV4__ 1
    167 
    168 // RUN: %clang -target armv7-none-linux-gnueabi -mcpu=cortex-a5 -mfpu=none -x c -E -dM %s -o - | FileCheck --check-prefix=FPUNONE-A5 %s
    169 // RUN: %clang -target armv7-none-linux-gnueabi -mthumb -mcpu=cortex-a5 -mfpu=none -x c -E -dM %s -o - | FileCheck --check-prefix=FPUNONE-A5 %s
    170 // FPUNONE-A5-NOT:#define __ARM_FP 0x{{.*}}
    171 // FPUNONE-A5-NOT:#define __ARM_NEON__ 1
    172 // FPUNONE-A5-NOT:#define __ARM_VFPV4__ 1
    173 
    174 // RUN: %clang -target armv7-none-linux-gnueabi -mcpu=cortex-a5 -mfpu=vfp4-d16 -x c -E -dM %s -o - | FileCheck --check-prefix=NONEON-A5 %s
    175 // RUN: %clang -target armv7-none-linux-gnueabi -mthumb -mcpu=cortex-a5 -mfpu=vfp4-d16 -x c -E -dM %s -o - | FileCheck --check-prefix=NONEON-A5 %s
    176 // NONEON-A5:#define __ARM_FP 0xE
    177 // NONEON-A5-NOT:#define __ARM_NEON__ 1
    178 // NONEON-A5:#define __ARM_VFPV4__ 1
    179 
    180 // FIXME: add check for further predefines
    181 // Test whether predefines are as expected when targeting ep9312.
    182 // RUN: %clang -target armv4t -mcpu=ep9312 -x c -E -dM %s -o - | FileCheck --check-prefix=A4T %s
    183 // A4T-NOT:#define __ARM_FEATURE_DSP
    184 // A4T-NOT:#define __ARM_FP 0x{{.*}}
    185 
    186 // Test whether predefines are as expected when targeting arm10tdmi.
    187 // RUN: %clang -target armv5 -mcpu=arm10tdmi -x c -E -dM %s -o - | FileCheck --check-prefix=A5T %s
    188 // A5T-NOT:#define __ARM_FEATURE_DSP
    189 // A5T-NOT:#define __ARM_FP 0x{{.*}}
    190 
    191 // Test whether predefines are as expected when targeting cortex-a5.
    192 // RUN: %clang -target armv7 -mcpu=cortex-a5 -x c -E -dM %s -o - | FileCheck --check-prefix=A5-ARM %s
    193 // A5-ARM-NOT:#define __ARM_ARCH_EXT_IDIV__
    194 // A5-ARM:#define __ARM_FEATURE_DSP
    195 // A5-ARM:#define __ARM_FP 0xE
    196 
    197 // RUN: %clang -target armv7 -mthumb -mcpu=cortex-a5 -x c -E -dM %s -o - | FileCheck --check-prefix=A5-THUMB %s
    198 // A5-THUMB-NOT:#define __ARM_ARCH_EXT_IDIV__
    199 // A5-THUMB:#define __ARM_FEATURE_DSP
    200 // A5-THUMB:#define __ARM_FP 0xE
    201 
    202 // RUN: %clang -target armv7 -mcpu=cortex-a5 -x c -E -dM %s -o - | FileCheck --check-prefix=A5 %s
    203 // RUN: %clang -target armv7 -mthumb -mcpu=cortex-a5 -x c -E -dM %s -o - | FileCheck --check-prefix=A5 %s
    204 // A5:#define __ARM_ARCH 7
    205 // A5:#define __ARM_ARCH_7A__ 1
    206 // A5:#define __ARM_ARCH_PROFILE 'A'
    207 // A5-NOT: #define __ARM_FEATURE_NUMERIC_MAXMIN
    208 // A5-NOT: #define __ARM_FEATURE_DIRECTED_ROUNDING
    209 // A5:#define __ARM_FEATURE_DSP
    210 // A5:#define __ARM_FP 0xE
    211 
    212 // Test whether predefines are as expected when targeting cortex-a7.
    213 // RUN: %clang -target armv7k -mcpu=cortex-a7 -x c -E -dM %s -o - | FileCheck --check-prefix=A7 %s
    214 // RUN: %clang -target armv7k -mthumb -mcpu=cortex-a7 -x c -E -dM %s -o - | FileCheck --check-prefix=A7 %s
    215 // A7:#define __ARM_ARCH 7
    216 // A7:#define __ARM_ARCH_EXT_IDIV__ 1
    217 // A7:#define __ARM_ARCH_PROFILE 'A'
    218 // A7:#define __ARM_FEATURE_DSP
    219 // A7:#define __ARM_FP 0xE
    220 
    221 // Test whether predefines are as expected when targeting cortex-a8.
    222 // RUN: %clang -target armv7 -mcpu=cortex-a8 -x c -E -dM %s -o - | FileCheck --check-prefix=A8-ARM %s
    223 // A8-ARM-NOT:#define __ARM_ARCH_EXT_IDIV__
    224 // A8-ARM:#define __ARM_FEATURE_DSP
    225 // A8-ARM:#define __ARM_FP 0xC
    226 
    227 // RUN: %clang -target armv7 -mthumb -mcpu=cortex-a8 -x c -E -dM %s -o - | FileCheck --check-prefix=A8-THUMB %s
    228 // A8-THUMB-NOT:#define __ARM_ARCH_EXT_IDIV__
    229 // A8-THUMB:#define __ARM_FEATURE_DSP
    230 // A8-THUMB:#define __ARM_FP 0xC
    231 
    232 // Test whether predefines are as expected when targeting cortex-a9.
    233 // RUN: %clang -target armv7 -mcpu=cortex-a9 -x c -E -dM %s -o - | FileCheck --check-prefix=A9-ARM %s
    234 // A9-ARM-NOT:#define __ARM_ARCH_EXT_IDIV__
    235 // A9-ARM:#define __ARM_FEATURE_DSP
    236 // A9-ARM:#define __ARM_FP 0xE
    237 
    238 // RUN: %clang -target armv7 -mthumb -mcpu=cortex-a9 -x c -E -dM %s -o - | FileCheck --check-prefix=A9-THUMB %s
    239 // A9-THUMB-NOT:#define __ARM_ARCH_EXT_IDIV__
    240 // A9-THUMB:#define __ARM_FEATURE_DSP
    241 // A9-THUMB:#define __ARM_FP 0xE
    242 
    243 
    244 // Check that -mfpu works properly for Cortex-A12 (enabled by default).
    245 // RUN: %clang -target armv7-none-linux-gnueabi -mcpu=cortex-a12 -x c -E -dM %s -o - | FileCheck --check-prefix=DEFAULTFPU-A12 %s
    246 // RUN: %clang -target armv7-none-linux-gnueabi -mthumb -mcpu=cortex-a12 -x c -E -dM %s -o - | FileCheck --check-prefix=DEFAULTFPU-A12 %s
    247 // DEFAULTFPU-A12:#define __ARM_FP 0xE
    248 // DEFAULTFPU-A12:#define __ARM_NEON__ 1
    249 // DEFAULTFPU-A12:#define __ARM_VFPV4__ 1
    250 
    251 // RUN: %clang -target armv7-none-linux-gnueabi -mcpu=cortex-a12 -mfpu=none -x c -E -dM %s -o - | FileCheck --check-prefix=FPUNONE-A12 %s
    252 // RUN: %clang -target armv7-none-linux-gnueabi -mthumb -mcpu=cortex-a12 -mfpu=none -x c -E -dM %s -o - | FileCheck --check-prefix=FPUNONE-A12 %s
    253 // FPUNONE-A12-NOT:#define __ARM_FP 0x{{.*}}
    254 // FPUNONE-A12-NOT:#define __ARM_NEON__ 1
    255 // FPUNONE-A12-NOT:#define __ARM_VFPV4__ 1
    256 
    257 // Test whether predefines are as expected when targeting cortex-a12.
    258 // RUN: %clang -target armv7 -mcpu=cortex-a12 -x c -E -dM %s -o - | FileCheck --check-prefix=A12 %s
    259 // RUN: %clang -target armv7 -mthumb -mcpu=cortex-a12 -x c -E -dM %s -o - | FileCheck --check-prefix=A12 %s
    260 // A12:#define __ARM_ARCH 7
    261 // A12:#define __ARM_ARCH_7A__ 1
    262 // A12:#define __ARM_ARCH_EXT_IDIV__ 1
    263 // A12:#define __ARM_ARCH_PROFILE 'A'
    264 // A12:#define __ARM_FEATURE_DSP
    265 // A12:#define __ARM_FP 0xE
    266 
    267 // Test whether predefines are as expected when targeting cortex-a15.
    268 // RUN: %clang -target armv7 -mcpu=cortex-a15 -x c -E -dM %s -o - | FileCheck --check-prefix=A15-ARM %s
    269 // A15-ARM:#define __ARM_ARCH_EXT_IDIV__ 1
    270 // A15-ARM:#define __ARM_FEATURE_DSP
    271 // A15-ARM:#define __ARM_FP 0xE
    272 
    273 // RUN: %clang -target armv7 -mthumb -mcpu=cortex-a15 -x c -E -dM %s -o - | FileCheck --check-prefix=A15-THUMB %s
    274 // A15-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
    275 // A15-THUMB:#define __ARM_FEATURE_DSP
    276 // A15-THUMB:#define __ARM_FP 0xE
    277 
    278 // Check that -mfpu works properly for Cortex-A17 (enabled by default).
    279 // RUN: %clang -target armv7-none-linux-gnueabi -mcpu=cortex-a17 -x c -E -dM %s -o - | FileCheck --check-prefix=DEFAULTFPU-A17 %s
    280 // RUN: %clang -target armv7-none-linux-gnueabi -mthumb -mcpu=cortex-a17 -x c -E -dM %s -o - | FileCheck --check-prefix=DEFAULTFPU-A17 %s
    281 // DEFAULTFPU-A17:#define __ARM_FP 0xE
    282 // DEFAULTFPU-A17:#define __ARM_NEON__ 1
    283 // DEFAULTFPU-A17:#define __ARM_VFPV4__ 1
    284 
    285 // RUN: %clang -target armv7-none-linux-gnueabi -mcpu=cortex-a17 -mfpu=none -x c -E -dM %s -o - | FileCheck --check-prefix=FPUNONE-A17 %s
    286 // RUN: %clang -target armv7-none-linux-gnueabi -mthumb -mcpu=cortex-a17 -mfpu=none -x c -E -dM %s -o - | FileCheck --check-prefix=FPUNONE-A17 %s
    287 // FPUNONE-A17-NOT:#define __ARM_FP 0x{{.*}}
    288 // FPUNONE-A17-NOT:#define __ARM_NEON__ 1
    289 // FPUNONE-A17-NOT:#define __ARM_VFPV4__ 1
    290 
    291 // Test whether predefines are as expected when targeting cortex-a17.
    292 // RUN: %clang -target armv7 -mcpu=cortex-a17 -x c -E -dM %s -o - | FileCheck --check-prefix=A17 %s
    293 // RUN: %clang -target armv7 -mthumb -mcpu=cortex-a17 -x c -E -dM %s -o - | FileCheck --check-prefix=A17 %s
    294 // A17:#define __ARM_ARCH 7
    295 // A17:#define __ARM_ARCH_7A__ 1
    296 // A17:#define __ARM_ARCH_EXT_IDIV__ 1
    297 // A17:#define __ARM_ARCH_PROFILE 'A'
    298 // A17:#define __ARM_FEATURE_DSP
    299 // A17:#define __ARM_FP 0xE
    300 
    301 // Test whether predefines are as expected when targeting swift.
    302 // RUN: %clang -target armv7s -mcpu=swift -x c -E -dM %s -o - | FileCheck --check-prefix=SWIFT-ARM %s
    303 // SWIFT-ARM:#define __ARM_ARCH_EXT_IDIV__ 1
    304 // SWIFT-ARM:#define __ARM_FEATURE_DSP
    305 // SWIFT-ARM:#define __ARM_FP 0xE
    306 
    307 // RUN: %clang -target armv7s -mthumb -mcpu=swift -x c -E -dM %s -o - | FileCheck --check-prefix=SWIFT-THUMB %s
    308 // SWIFT-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
    309 // SWIFT-THUMB:#define __ARM_FEATURE_DSP
    310 // SWIFT-THUMB:#define __ARM_FP 0xE
    311 
    312 // Test whether predefines are as expected when targeting cortex-a53.
    313 // RUN: %clang -target armv8 -mcpu=cortex-a53 -x c -E -dM %s -o - | FileCheck --check-prefix=A53-ARM %s
    314 // A53-ARM:#define __ARM_ARCH_EXT_IDIV__ 1
    315 // A53-ARM:#define __ARM_FEATURE_DSP
    316 // A53-ARM:#define __ARM_FP 0xE
    317 
    318 // RUN: %clang -target armv8 -mthumb -mcpu=cortex-a53 -x c -E -dM %s -o - | FileCheck --check-prefix=A53-THUMB %s
    319 // A53-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
    320 // A53-THUMB:#define __ARM_FEATURE_DSP
    321 // A53-THUMB:#define __ARM_FP 0xE
    322 
    323 // Test whether predefines are as expected when targeting cortex-r4.
    324 // RUN: %clang -target armv7 -mcpu=cortex-r4 -x c -E -dM %s -o - | FileCheck --check-prefix=R4-ARM %s
    325 // R4-ARM-NOT:#define __ARM_ARCH_EXT_IDIV__
    326 // R4-ARM:#define __ARM_FEATURE_DSP
    327 // R4-ARM-NOT:#define __ARM_FP 0x{{.*}}
    328 
    329 // RUN: %clang -target armv7 -mthumb -mcpu=cortex-r4 -x c -E -dM %s -o - | FileCheck --check-prefix=R4-THUMB %s
    330 // R4-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
    331 // R4-THUMB:#define __ARM_FEATURE_DSP
    332 // R4-THUMB-NOT:#define __ARM_FP 0x{{.*}}
    333 
    334 // Test whether predefines are as expected when targeting cortex-r4f.
    335 // RUN: %clang -target armv7 -mcpu=cortex-r4f -x c -E -dM %s -o - | FileCheck --check-prefix=R4F-ARM %s
    336 // R4F-ARM-NOT:#define __ARM_ARCH_EXT_IDIV__
    337 // R4F-ARM:#define __ARM_FEATURE_DSP
    338 // R4F-ARM:#define __ARM_FP 0xC
    339 
    340 // RUN: %clang -target armv7 -mthumb -mcpu=cortex-r4f -x c -E -dM %s -o - | FileCheck --check-prefix=R4F-THUMB %s
    341 // R4F-THUMBT:#define __ARM_ARCH_EXT_IDIV__ 1
    342 // R4F-THUMB:#define __ARM_FEATURE_DSP
    343 // R4F-THUMB:#define __ARM_FP 0xC
    344 
    345 // Test whether predefines are as expected when targeting cortex-r5.
    346 // RUN: %clang -target armv7 -mcpu=cortex-r5 -x c -E -dM %s -o - | FileCheck --check-prefix=R5-ARM %s
    347 // R5-ARM:#define __ARM_ARCH_EXT_IDIV__ 1
    348 // R5-ARM:#define __ARM_FEATURE_DSP
    349 // R5-ARM:#define __ARM_FP 0xC
    350 
    351 // RUN: %clang -target armv7 -mthumb -mcpu=cortex-r5 -x c -E -dM %s -o - | FileCheck --check-prefix=R5-THUMB %s
    352 // R5-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
    353 // R5-THUMB:#define __ARM_FEATURE_DSP
    354 // R5-THUMB:#define __ARM_FP 0xC
    355 
    356 // Test whether predefines are as expected when targeting cortex-r7.
    357 // RUN: %clang -target armv7 -mcpu=cortex-r7 -x c -E -dM %s -o - | FileCheck --check-prefix=R7-ARM %s
    358 // R7-ARM:#define __ARM_ARCH_EXT_IDIV__ 1
    359 // R7-ARM:#define __ARM_FEATURE_DSP
    360 // R7-ARM:#define __ARM_FP 0xE
    361 
    362 // RUN: %clang -target armv7 -mthumb -mcpu=cortex-r7 -x c -E -dM %s -o - | FileCheck --check-prefix=R7-THUMB %s
    363 // R7-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
    364 // R7-THUMB:#define __ARM_FEATURE_DSP
    365 // R7-THUMB:#define __ARM_FP 0xE
    366 
    367 // Test whether predefines are as expected when targeting cortex-m0.
    368 // RUN: %clang -target armv7 -mthumb -mcpu=cortex-m0 -x c -E -dM %s -o - | FileCheck --check-prefix=M0-THUMB %s
    369 // RUN: %clang -target armv7 -mthumb -mcpu=cortex-m0plus -x c -E -dM %s -o - | FileCheck --check-prefix=M0-THUMB %s
    370 // RUN: %clang -target armv7 -mthumb -mcpu=cortex-m1 -x c -E -dM %s -o - | FileCheck --check-prefix=M0-THUMB %s
    371 // RUN: %clang -target armv7 -mthumb -mcpu=sc000 -x c -E -dM %s -o - | FileCheck --check-prefix=M0-THUMB %s
    372 // M0-THUMB-NOT:#define __ARM_ARCH_EXT_IDIV__
    373 // M0-THUMB-NOT:#define __ARM_FEATURE_DSP
    374 // M0-THUMB-NOT:#define __ARM_FP 0x{{.*}}
    375 
    376 // Test whether predefines are as expected when targeting cortex-m3.
    377 // RUN: %clang -target armv7 -mthumb -mcpu=cortex-m3 -x c -E -dM %s -o - | FileCheck --check-prefix=M3-THUMB %s
    378 // RUN: %clang -target armv7 -mthumb -mcpu=sc300 -x c -E -dM %s -o - | FileCheck --check-prefix=M3-THUMB %s
    379 // M3-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
    380 // M3-THUMB-NOT:#define __ARM_FEATURE_DSP
    381 // M3-THUMB-NOT:#define __ARM_FP 0x{{.*}}
    382 
    383 // Test whether predefines are as expected when targeting cortex-m4.
    384 // RUN: %clang -target armv7 -mthumb -mcpu=cortex-m4 -x c -E -dM %s -o - | FileCheck --check-prefix=M4-THUMB %s
    385 // M4-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
    386 // M4-THUMB:#define __ARM_FEATURE_DSP
    387 // M4-THUMB:#define __ARM_FP 0x6
    388 
    389 // Test whether predefines are as expected when targeting cortex-m7.
    390 // RUN: %clang -target armv7 -mthumb -mcpu=cortex-m7 -x c -E -dM %s -o - | FileCheck --check-prefix=M7-THUMB %s
    391 // M7-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
    392 // M7-THUMB:#define __ARM_FEATURE_DSP
    393 // M7-THUMB:#define __ARM_FP 0xE
    394 
    395 // Test whether predefines are as expected when targeting krait.
    396 // RUN: %clang -target armv7 -mcpu=krait -x c -E -dM %s -o - | FileCheck --check-prefix=KRAIT-ARM %s
    397 // KRAIT-ARM:#define __ARM_ARCH_EXT_IDIV__ 1
    398 // KRAIT-ARM:#define __ARM_FEATURE_DSP
    399 // KRAIT-ARM:#define  __ARM_VFPV4__ 1
    400 
    401 // RUN: %clang -target armv7 -mthumb -mcpu=krait -x c -E -dM %s -o - | FileCheck --check-prefix=KRAIT-THUMB %s
    402 // KRAIT-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
    403 // KRAIT-THUMB:#define __ARM_FEATURE_DSP
    404 // KRAIT-THUMB:#define  __ARM_VFPV4__ 1
    405 
    406 // RUN: %clang -target armv8.1a-none-none-eabi -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-V81A %s
    407 // CHECK-V81A: __ARM_ARCH 8
    408 // CHECK-V81A: __ARM_ARCH_8_1A__ 1
    409 // CHECK-V81A: #define __ARM_ARCH_PROFILE 'A'
    410 // CHECK-V81A: __ARM_FEATURE_QRDMX 1
    411 // CHECK-V81A: #define __ARM_FP 0xE
    412