blob: 58bc7192d7f9fa4656aeadbd52cc22ec77bb85bc [file] [log] [blame]
Tim Northover9bb857a2013-01-31 12:13:10 +00001// RUN: %clang -target aarch64-none-linux-gnu -x c -E -dM %s -o - | FileCheck %s
James Molloy96061a62014-04-17 12:51:36 +00002// RUN: %clang -target arm64-none-linux-gnu -x c -E -dM %s -o - | FileCheck %s
Jiangning Liuc8b0a1a2013-11-19 01:33:17 +00003
4// CHECK: __AARCH64EL__ 1
5// CHECK: __ARM_64BIT_STATE 1
Alexandros Lamprineasa448f042015-09-03 14:40:57 +00006// CHECK-NOT: __ARM_32BIT_STATE
Jiangning Liuc8b0a1a2013-11-19 01:33:17 +00007// CHECK: __ARM_ACLE 200
8// CHECK: __ARM_ALIGN_MAX_STACK_PWR 4
Tim Northoverb85654d2013-04-05 14:08:55 +00009// CHECK: __ARM_ARCH 8
Jiangning Liuc8b0a1a2013-11-19 01:33:17 +000010// CHECK: __ARM_ARCH_ISA_A64 1
Alexandros Lamprineasa448f042015-09-03 14:40:57 +000011// CHECK-NOT: __ARM_ARCH_ISA_ARM
12// CHECK-NOT: __ARM_ARCH_ISA_THUMB
13// CHECK-NOT: __ARM_FEATURE_QBIT
14// CHECK-NOT: __ARM_FEATURE_DSP
15// CHECK-NOT: __ARM_FEATURE_SAT
16// CHECK-NOT: __ARM_FEATURE_SIMD32
Tim Northoverb85654d2013-04-05 14:08:55 +000017// CHECK: __ARM_ARCH_PROFILE 'A'
18// CHECK-NOT: __ARM_FEATURE_BIG_ENDIAN
19// CHECK: __ARM_FEATURE_CLZ 1
Bradley Smith418c5932014-05-02 15:17:51 +000020// CHECK-NOT: __ARM_FEATURE_CRC32 1
Jiangning Liuc8b0a1a2013-11-19 01:33:17 +000021// CHECK-NOT: __ARM_FEATURE_CRYPTO 1
James Molloy0ffb0932014-09-15 11:25:38 +000022// CHECK: __ARM_FEATURE_DIRECTED_ROUNDING 1
Jiangning Liuc8b0a1a2013-11-19 01:33:17 +000023// CHECK: __ARM_FEATURE_DIV 1
Tim Northoverb85654d2013-04-05 14:08:55 +000024// CHECK: __ARM_FEATURE_FMA 1
James Molloy0ffb0932014-09-15 11:25:38 +000025// CHECK: __ARM_FEATURE_IDIV 1
Alexandros Lamprineasa448f042015-09-03 14:40:57 +000026// CHECK: __ARM_FEATURE_LDREX 0xF
James Molloy0ffb0932014-09-15 11:25:38 +000027// CHECK: __ARM_FEATURE_NUMERIC_MAXMIN 1
Tim Northoverb85654d2013-04-05 14:08:55 +000028// CHECK: __ARM_FEATURE_UNALIGNED 1
Alexandros Lamprineasa448f042015-09-03 14:40:57 +000029// CHECK: __ARM_FP 0xE
Keith Walker71ad47f2015-08-24 10:11:14 +000030// CHECK: __ARM_FP16_ARGS 1
Tim Northoverb85654d2013-04-05 14:08:55 +000031// CHECK: __ARM_FP16_FORMAT_IEEE 1
Jiangning Liuc8b0a1a2013-11-19 01:33:17 +000032// CHECK-NOT: __ARM_FP_FAST 1
Jiangning Liub19c5b62014-02-14 04:37:46 +000033// CHECK: __ARM_NEON 1
Alexandros Lamprineasa448f042015-09-03 14:40:57 +000034// CHECK: __ARM_NEON_FP 0xE
Jiangning Liuc8b0a1a2013-11-19 01:33:17 +000035// CHECK: __ARM_PCS_AAPCS64 1
Alexandros Lamprineasf5a8e6c2015-10-02 14:56:37 +000036// CHECK-NOT: __ARM_PCS 1
37// CHECK-NOT: __ARM_PCS_VFP 1
Jiangning Liuc8b0a1a2013-11-19 01:33:17 +000038// CHECK-NOT: __ARM_SIZEOF_MINIMAL_ENUM 1
39// CHECK-NOT: __ARM_SIZEOF_WCHAR_T 2
Amara Emersonebe02902017-07-13 15:36:01 +000040// CHECK-NOT: __ARM_FEATURE_SVE
Junmo Park4b9b9fb2018-04-17 22:38:40 +000041// CHECK-NOT: __ARM_FEATURE_DOTPROD
Tim Northover9bb857a2013-01-31 12:13:10 +000042
Alexandros Lamprineasa448f042015-09-03 14:40:57 +000043// RUN: %clang -target aarch64_be-eabi -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-BIGENDIAN
44// CHECK-BIGENDIAN: __ARM_BIG_ENDIAN 1
45
Kevin Qin110db6f2014-07-18 07:03:22 +000046// RUN: %clang -target aarch64-none-linux-gnu -march=armv8-a+crypto -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-CRYPTO %s
47// RUN: %clang -target arm64-none-linux-gnu -march=armv8-a+crypto -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-CRYPTO %s
Jiangning Liuc8b0a1a2013-11-19 01:33:17 +000048// CHECK-CRYPTO: __ARM_FEATURE_CRYPTO 1
Tim Northover9bb857a2013-01-31 12:13:10 +000049
Bradley Smith418c5932014-05-02 15:17:51 +000050// RUN: %clang -target aarch64-none-linux-gnu -mcrc -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-CRC32 %s
51// RUN: %clang -target arm64-none-linux-gnu -mcrc -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-CRC32 %s
Kevin Qin110db6f2014-07-18 07:03:22 +000052// RUN: %clang -target aarch64-none-linux-gnu -march=armv8-a+crc -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-CRC32 %s
53// RUN: %clang -target arm64-none-linux-gnu -march=armv8-a+crc -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-CRC32 %s
Bradley Smith418c5932014-05-02 15:17:51 +000054// CHECK-CRC32: __ARM_FEATURE_CRC32 1
55
Alexandros Lamprineasf5a8e6c2015-10-02 14:56:37 +000056// RUN: %clang -target aarch64-none-linux-gnu -fno-math-errno -fno-signed-zeros\
57// RUN: -fno-trapping-math -fassociative-math -freciprocal-math\
58// RUN: -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-FASTMATH %s
Tim Northover9bb857a2013-01-31 12:13:10 +000059// RUN: %clang -target aarch64-none-linux-gnu -ffast-math -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-FASTMATH %s
Bradley Smith9a6b2952014-05-02 15:18:38 +000060// RUN: %clang -target arm64-none-linux-gnu -ffast-math -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-FASTMATH %s
Jiangning Liuc8b0a1a2013-11-19 01:33:17 +000061// CHECK-FASTMATH: __ARM_FP_FAST 1
Tim Northover9bb857a2013-01-31 12:13:10 +000062
63// RUN: %clang -target aarch64-none-linux-gnu -fshort-wchar -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-SHORTWCHAR %s
Bradley Smith9a6b2952014-05-02 15:18:38 +000064// RUN: %clang -target arm64-none-linux-gnu -fshort-wchar -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-SHORTWCHAR %s
Tim Northoverb85654d2013-04-05 14:08:55 +000065// CHECK-SHORTWCHAR: __ARM_SIZEOF_WCHAR_T 2
Tim Northover9bb857a2013-01-31 12:13:10 +000066
67// RUN: %clang -target aarch64-none-linux-gnu -fshort-enums -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-SHORTENUMS %s
Bradley Smith9a6b2952014-05-02 15:18:38 +000068// RUN: %clang -target arm64-none-linux-gnu -fshort-enums -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-SHORTENUMS %s
Tim Northoverb85654d2013-04-05 14:08:55 +000069// CHECK-SHORTENUMS: __ARM_SIZEOF_MINIMAL_ENUM 1
Tim Northover9bb857a2013-01-31 12:13:10 +000070
Kevin Qin110db6f2014-07-18 07:03:22 +000071// RUN: %clang -target aarch64-none-linux-gnu -march=armv8-a+simd -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-NEON %s
72// RUN: %clang -target arm64-none-linux-gnu -march=armv8-a+simd -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-NEON %s
Jiangning Liuc8b0a1a2013-11-19 01:33:17 +000073// CHECK-NEON: __ARM_NEON 1
Alexandros Lamprineasa448f042015-09-03 14:40:57 +000074// CHECK-NEON: __ARM_NEON_FP 0xE
Kevin Qinafd88472014-06-11 01:42:16 +000075
Sjoerd Meijercb75f612017-06-30 08:07:34 +000076// RUN: %clang -target aarch64-none-eabi -march=armv8.1-a -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-QRDMX %s
77// RUN: %clang -target aarch64-none-eabi -march=armv8.2-a -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-QRDMX %s
78// CHECK-QRDMX: __ARM_FEATURE_QRDMX 1
Alexandros Lamprineas502592c2015-11-29 10:43:59 +000079
Kevin Qin110db6f2014-07-18 07:03:22 +000080// RUN: %clang -target aarch64 -march=arm64 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-ARCH-NOT-ACCEPT %s
81// RUN: %clang -target aarch64 -march=aarch64 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-ARCH-NOT-ACCEPT %s
82// CHECK-ARCH-NOT-ACCEPT: error: the clang compiler does not support
Kevin Qinafd88472014-06-11 01:42:16 +000083
Kevin Qin110db6f2014-07-18 07:03:22 +000084// RUN: %clang -target aarch64 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-GENERIC %s
85// RUN: %clang -target aarch64 -march=armv8-a -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-GENERIC %s
86// CHECK-GENERIC: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-feature" "+neon"
Kevin Qinafd88472014-06-11 01:42:16 +000087
Kevin Qin110db6f2014-07-18 07:03:22 +000088// RUN: %clang -target aarch64 -mtune=cyclone -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MTUNE-CYCLONE %s
Amara Emersonebe02902017-07-13 15:36:01 +000089
90// RUN: %clang -target aarch64-none-linux-gnu -march=armv8-a+sve -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-SVE %s
91// CHECK-SVE: __ARM_FEATURE_SVE 1
92
Junmo Park4b9b9fb2018-04-17 22:38:40 +000093// RUN: %clang -target aarch64-none-linux-gnu -march=armv8.2a+dotprod -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-DOTPROD %s
94// CHECK-DOTPROD: __ARM_FEATURE_DOTPROD 1
95
Sjoerd Meijerc0176562018-09-24 07:55:20 +000096// RUN: %clang -target aarch64-none-linux-gnueabi -march=armv8.2-a+nofp16fml+fp16 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FULLFP16-VECTOR-SCALAR %s
97// RUN: %clang -target aarch64-none-linux-gnueabi -march=armv8.2-a+nofp16+fp16fml -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FULLFP16-VECTOR-SCALAR %s
98// RUN: %clang -target aarch64-none-linux-gnueabi -march=armv8.2-a+fp16+nofp16fml -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FULLFP16-VECTOR-SCALAR %s
99// RUN: %clang -target aarch64-none-linux-gnueabi -march=armv8-a+fp16fml -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FULLFP16-VECTOR-SCALAR %s
100// RUN: %clang -target aarch64-none-linux-gnueabi -march=armv8-a+fp16 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FULLFP16-VECTOR-SCALAR %s
101// RUN: %clang -target aarch64-none-linux-gnueabi -march=armv8.4-a+nofp16fml+fp16 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FULLFP16-VECTOR-SCALAR %s
102// RUN: %clang -target aarch64-none-linux-gnueabi -march=armv8.4-a+nofp16+fp16fml -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FULLFP16-VECTOR-SCALAR %s
103// RUN: %clang -target aarch64-none-linux-gnueabi -march=armv8.4-a+fp16+nofp16fml -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FULLFP16-VECTOR-SCALAR %s
104// RUN: %clang -target aarch64-none-linux-gnueabi -march=armv8.4-a+fp16fml -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FULLFP16-VECTOR-SCALAR %s
105// RUN: %clang -target aarch64-none-linux-gnueabi -march=armv8.4-a+fp16 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FULLFP16-VECTOR-SCALAR %s
Sjoerd Meijer50944d62018-03-15 13:36:30 +0000106// CHECK-FULLFP16-VECTOR-SCALAR: #define __ARM_FEATURE_FP16_SCALAR_ARITHMETIC 1
107// CHECK-FULLFP16-VECTOR-SCALAR: #define __ARM_FEATURE_FP16_VECTOR_ARITHMETIC 1
108// CHECK-FULLFP16-VECTOR-SCALAR: #define __ARM_FP 0xE
109// CHECK-FULLFP16-VECTOR-SCALAR: #define __ARM_FP16_FORMAT_IEEE 1
110
Sjoerd Meijerc0176562018-09-24 07:55:20 +0000111// +fp16fml+nosimd doesn't make sense as the fp16fml instructions all require SIMD.
112// However, as +fp16fml implies +fp16 there is a set of defines that we would expect.
113// RUN: %clang -target aarch64-none-linux-gnueabi -march=armv8-a+fp16fml+nosimd -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FULLFP16-SCALAR %s
114// RUN: %clang -target aarch64-none-linux-gnueabi -march=armv8-a+fp16+nosimd -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FULLFP16-SCALAR %s
115// RUN: %clang -target aarch64-none-linux-gnueabi -march=armv8.4-a+fp16fml+nosimd -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FULLFP16-SCALAR %s
116// RUN: %clang -target aarch64-none-linux-gnueabi -march=armv8.4-a+fp16+nosimd -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FULLFP16-SCALAR %s
Sjoerd Meijer50944d62018-03-15 13:36:30 +0000117// CHECK-FULLFP16-SCALAR: #define __ARM_FEATURE_FP16_SCALAR_ARITHMETIC 1
118// CHECK-FULLFP16-SCALAR-NOT: #define __ARM_FEATURE_FP16_VECTOR_ARITHMETIC 1
119// CHECK-FULLFP16-SCALAR: #define __ARM_FP 0xE
120// CHECK-FULLFP16-SCALAR: #define __ARM_FP16_FORMAT_IEEE 1
121
Sjoerd Meijerc0176562018-09-24 07:55:20 +0000122// RUN: %clang -target aarch64-none-linux-gnueabi -march=armv8.2-a -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FULLFP16-NOFML-VECTOR-SCALAR %s
123// RUN: %clang -target aarch64-none-linux-gnueabi -march=armv8.2-a+nofp16 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FULLFP16-NOFML-VECTOR-SCALAR %s
124// RUN: %clang -target aarch64-none-linux-gnueabi -march=armv8.2-a+nofp16fml -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FULLFP16-NOFML-VECTOR-SCALAR %s
125// RUN: %clang -target aarch64-none-linux-gnueabi -march=armv8.2-a+fp16fml+nofp16 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FULLFP16-NOFML-VECTOR-SCALAR %s
126// RUN: %clang -target aarch64-none-linux-gnueabi -march=armv8.4-a -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FULLFP16-NOFML-VECTOR-SCALAR %s
127// RUN: %clang -target aarch64-none-linux-gnueabi -march=armv8.4-a+nofp16 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FULLFP16-NOFML-VECTOR-SCALAR %s
128// RUN: %clang -target aarch64-none-linux-gnueabi -march=armv8.4-a+nofp16fml -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FULLFP16-NOFML-VECTOR-SCALAR %s
129// RUN: %clang -target aarch64-none-linux-gnueabi -march=armv8.4-a+fp16fml+nofp16 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FULLFP16-NOFML-VECTOR-SCALAR %s
130// CHECK-FULLFP16-NOFML-VECTOR-SCALAR-NOT: #define __ARM_FEATURE_FP16_SCALAR_ARITHMETIC 1
131// CHECK-FULLFP16-NOFML-VECTOR-SCALAR-NOT: #define __ARM_FEATURE_FP16_VECTOR_ARITHMETIC 1
132// CHECK-FULLFP16-NOFML-VECTOR-SCALAR: #define __ARM_FP 0xE
133// CHECK-FULLFP16-NOFML-VECTOR-SCALAR: #define __ARM_FP16_FORMAT_IEEE 1
134
Gabor Ballabasa24a1a42015-07-20 11:28:20 +0000135// ================== Check whether -mtune accepts mixed-case features.
136// RUN: %clang -target aarch64 -mtune=CYCLONE -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MTUNE-CYCLONE %s
Kevin Qin110db6f2014-07-18 07:03:22 +0000137// CHECK-MTUNE-CYCLONE: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-feature" "+neon" "-target-feature" "+zcm" "-target-feature" "+zcz"
138
139// RUN: %clang -target aarch64 -mcpu=cyclone -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MCPU-CYCLONE %s
Christof Doumaba13ad52015-12-02 12:03:42 +0000140// RUN: %clang -target aarch64 -mcpu=cortex-a35 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MCPU-A35 %s
Kevin Qin110db6f2014-07-18 07:03:22 +0000141// RUN: %clang -target aarch64 -mcpu=cortex-a53 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MCPU-A53 %s
142// RUN: %clang -target aarch64 -mcpu=cortex-a57 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MCPU-A57 %s
Renato Golin84545d72015-02-04 13:31:56 +0000143// RUN: %clang -target aarch64 -mcpu=cortex-a72 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MCPU-A72 %s
Sjoerd Meijer90df4a72016-06-02 10:48:37 +0000144// RUN: %clang -target aarch64 -mcpu=cortex-a73 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MCPU-CORTEX-A73 %s
MinSeong Kim50d9c152016-01-05 12:53:24 +0000145// RUN: %clang -target aarch64 -mcpu=exynos-m1 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MCPU-M1 %s
Evandro Menezesec133b32016-08-01 18:39:55 +0000146// RUN: %clang -target aarch64 -mcpu=exynos-m2 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MCPU-M1 %s
Evandro Menezesba177752016-12-13 23:31:57 +0000147// RUN: %clang -target aarch64 -mcpu=exynos-m3 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MCPU-M1 %s
Evandro Menezes08045232018-06-06 18:58:01 +0000148// RUN: %clang -target aarch64 -mcpu=exynos-m4 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MCPU-M1 %s
Chad Rosierb0ce1952016-02-11 18:09:31 +0000149// RUN: %clang -target aarch64 -mcpu=kryo -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MCPU-KRYO %s
Joel Jones15467df2017-03-07 21:24:53 +0000150// RUN: %clang -target aarch64 -mcpu=thunderx2t99 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MCPU-THUNDERX2T99 %s
Renato Golin3b8709c2016-05-25 12:36:31 +0000151// CHECK-MCPU-CYCLONE: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-feature" "+neon" "-target-feature" "+crypto" "-target-feature" "+zcm" "-target-feature" "+zcz"
Christof Doumaba13ad52015-12-02 12:03:42 +0000152// CHECK-MCPU-A35: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-feature" "+neon" "-target-feature" "+crc" "-target-feature" "+crypto"
Kevin Qin110db6f2014-07-18 07:03:22 +0000153// CHECK-MCPU-A53: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-feature" "+neon" "-target-feature" "+crc" "-target-feature" "+crypto"
154// CHECK-MCPU-A57: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-feature" "+neon" "-target-feature" "+crc" "-target-feature" "+crypto"
Renato Golin84545d72015-02-04 13:31:56 +0000155// CHECK-MCPU-A72: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-feature" "+neon" "-target-feature" "+crc" "-target-feature" "+crypto"
Sjoerd Meijer90df4a72016-06-02 10:48:37 +0000156// CHECK-MCPU-CORTEX-A73: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-feature" "+neon" "-target-feature" "+crc" "-target-feature" "+crypto"
MinSeong Kim50d9c152016-01-05 12:53:24 +0000157// CHECK-MCPU-M1: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-feature" "+neon" "-target-feature" "+crc" "-target-feature" "+crypto"
Chad Rosierb0ce1952016-02-11 18:09:31 +0000158// CHECK-MCPU-KRYO: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-feature" "+neon" "-target-feature" "+crc" "-target-feature" "+crypto"
Joel Jones15467df2017-03-07 21:24:53 +0000159// CHECK-MCPU-THUNDERX2T99: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-feature" "+neon" "-target-feature" "+crc" "-target-feature" "+crypto"
Kevin Qin110db6f2014-07-18 07:03:22 +0000160
Tim Northover642e7702014-11-10 21:17:23 +0000161// RUN: %clang -target x86_64-apple-macosx -arch arm64 -### -c %s 2>&1 | FileCheck --check-prefix=CHECK-ARCH-ARM64 %s
Ahmed Bougacha7e131f02017-05-03 20:34:32 +0000162// CHECK-ARCH-ARM64: "-target-cpu" "cyclone" "-target-feature" "+fp-armv8" "-target-feature" "+neon" "-target-feature" "+crypto" "-target-feature" "+zcm" "-target-feature" "+zcz"
Tim Northover642e7702014-11-10 21:17:23 +0000163
Kevin Qin110db6f2014-07-18 07:03:22 +0000164// RUN: %clang -target aarch64 -march=armv8-a+fp+simd+crc+crypto -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MARCH-1 %s
165// RUN: %clang -target aarch64 -march=armv8-a+nofp+nosimd+nocrc+nocrypto+fp+simd+crc+crypto -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MARCH-1 %s
166// RUN: %clang -target aarch64 -march=armv8-a+nofp+nosimd+nocrc+nocrypto -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MARCH-2 %s
167// RUN: %clang -target aarch64 -march=armv8-a+fp+simd+crc+crypto+nofp+nosimd+nocrc+nocrypto -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MARCH-2 %s
168// RUN: %clang -target aarch64 -march=armv8-a+nosimd -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MARCH-3 %s
169// CHECK-MARCH-1: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-feature" "+fp-armv8" "-target-feature" "+neon" "-target-feature" "+crc" "-target-feature" "+crypto"
170// CHECK-MARCH-2: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-feature" "-fp-armv8" "-target-feature" "-neon" "-target-feature" "-crc" "-target-feature" "-crypto"
171// CHECK-MARCH-3: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-feature" "-neon"
172
173// RUN: %clang -target aarch64 -mcpu=cyclone+nocrypto -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MCPU-1 %s
174// RUN: %clang -target aarch64 -mcpu=cyclone+crypto+nocrypto -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MCPU-1 %s
175// RUN: %clang -target aarch64 -mcpu=generic+crc -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MCPU-2 %s
176// RUN: %clang -target aarch64 -mcpu=generic+nocrc+crc -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MCPU-2 %s
177// RUN: %clang -target aarch64 -mcpu=cortex-a53+nosimd -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MCPU-3 %s
Gabor Ballabas726ce7f2015-06-12 17:33:37 +0000178// ================== Check whether -mcpu accepts mixed-case features.
179// RUN: %clang -target aarch64 -mcpu=cyclone+NOCRYPTO -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MCPU-1 %s
180// RUN: %clang -target aarch64 -mcpu=cyclone+CRYPTO+nocrypto -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MCPU-1 %s
181// RUN: %clang -target aarch64 -mcpu=generic+Crc -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MCPU-2 %s
182// RUN: %clang -target aarch64 -mcpu=GENERIC+nocrc+CRC -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MCPU-2 %s
183// RUN: %clang -target aarch64 -mcpu=cortex-a53+noSIMD -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MCPU-3 %s
Tim Northover2279b5f2016-02-24 17:57:48 +0000184// CHECK-MCPU-1: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-feature" "+neon" "-target-feature" "-crypto" "-target-feature" "+zcm" "-target-feature" "+zcz"
Kevin Qin110db6f2014-07-18 07:03:22 +0000185// CHECK-MCPU-2: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-feature" "+neon" "-target-feature" "+crc"
186// CHECK-MCPU-3: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-feature" "-neon"
187
188// RUN: %clang -target aarch64 -mcpu=cyclone+nocrc+nocrypto -march=armv8-a -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MCPU-MARCH %s
189// RUN: %clang -target aarch64 -march=armv8-a -mcpu=cyclone+nocrc+nocrypto -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MCPU-MARCH %s
190// CHECK-MCPU-MARCH: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-feature" "+neon" "-target-feature" "+zcm" "-target-feature" "+zcz"
191
192// RUN: %clang -target aarch64 -mcpu=cortex-a53 -mtune=cyclone -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MCPU-MTUNE %s
193// RUN: %clang -target aarch64 -mtune=cyclone -mcpu=cortex-a53 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MCPU-MTUNE %s
Gabor Ballabasa24a1a42015-07-20 11:28:20 +0000194// ================== Check whether -mtune accepts mixed-case features.
195// RUN: %clang -target aarch64 -mcpu=cortex-a53 -mtune=CYCLONE -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MCPU-MTUNE %s
196// RUN: %clang -target aarch64 -mtune=CyclonE -mcpu=cortex-a53 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MCPU-MTUNE %s
Kevin Qin110db6f2014-07-18 07:03:22 +0000197// CHECK-MCPU-MTUNE: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-feature" "+neon" "-target-feature" "+crc" "-target-feature" "+crypto" "-target-feature" "+zcm" "-target-feature" "+zcz"
198
199// RUN: %clang -target aarch64 -mcpu=generic+neon -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-ERROR-NEON %s
200// RUN: %clang -target aarch64 -mcpu=generic+noneon -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-ERROR-NEON %s
201// RUN: %clang -target aarch64 -march=armv8-a+neon -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-ERROR-NEON %s
202// RUN: %clang -target aarch64 -march=armv8-a+noneon -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-ERROR-NEON %s
203// CHECK-ERROR-NEON: error: [no]neon is not accepted as modifier, please use [no]simd instead
Vladimir Sukhareve851e042015-04-16 15:53:09 +0000204
205// RUN: %clang -target aarch64 -march=armv8.1a+crypto -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V81A-FEATURE-1 %s
206// RUN: %clang -target aarch64 -march=armv8.1a+nocrypto -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V81A-FEATURE-2 %s
207// RUN: %clang -target aarch64 -march=armv8.1a+nosimd -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V81A-FEATURE-3 %s
Gabor Ballabas36451492015-06-18 14:23:12 +0000208// ================== Check whether -march accepts mixed-case features.
209// RUN: %clang -target aarch64 -march=ARMV8.1A+CRYPTO -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V81A-FEATURE-1 %s
210// RUN: %clang -target aarch64 -march=Armv8.1a+NOcrypto -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V81A-FEATURE-2 %s
211// RUN: %clang -target aarch64 -march=armv8.1a+noSIMD -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V81A-FEATURE-3 %s
Vladimir Sukhareve851e042015-04-16 15:53:09 +0000212// CHECK-V81A-FEATURE-1: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-feature" "+neon" "-target-feature" "+v8.1a" "-target-feature" "+crypto"
213// CHECK-V81A-FEATURE-2: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-feature" "+neon" "-target-feature" "+v8.1a" "-target-feature" "-crypto"
214// CHECK-V81A-FEATURE-3: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-feature" "+v8.1a" "-target-feature" "-neon"
215