blob: 93fb0a8eb4360f7118c4ead9431626e61e42d2f7 [file] [log] [blame]
Evgeniy Stepanova7451552012-01-11 12:36:39 +00001// Test that different values of -mfpu pick correct ARM FPU target-feature(s).
2
Sebastian Pop422377c2012-01-20 22:01:23 +00003// RUN: %clang -target arm-linux-eabi %s -### -o %t.o 2>&1 \
Evgeniy Stepanova7451552012-01-11 12:36:39 +00004// RUN: | FileCheck --check-prefix=CHECK-DEFAULT %s
5// CHECK-DEFAULT-NOT: "-target-feature" "+vfp2"
6// CHECK-DEFAULT-NOT: "-target-feature" "+vfp3"
7// CHECK-DEFAULT-NOT: "-target-feature" "+d16"
8// CHECK-DEFAULT-NOT: "-target-feature" "+neon"
9
Sebastian Pop422377c2012-01-20 22:01:23 +000010// RUN: %clang -target arm-linux-eabi -mfpu=fpa %s -### -o %t.o 2>&1 \
Evgeniy Stepanov48af2a92012-01-11 11:21:31 +000011// RUN: | FileCheck --check-prefix=CHECK-FPA %s
Sebastian Pop422377c2012-01-20 22:01:23 +000012// RUN: %clang -target arm-linux-eabi -mfpu=fpe2 %s -### -o %t.o 2>&1 \
Evgeniy Stepanov48af2a92012-01-11 11:21:31 +000013// RUN: | FileCheck --check-prefix=CHECK-FPA %s
Sebastian Pop422377c2012-01-20 22:01:23 +000014// RUN: %clang -target arm-linux-eabi -mfpu=fpe3 %s -### -o %t.o 2>&1 \
Evgeniy Stepanov48af2a92012-01-11 11:21:31 +000015// RUN: | FileCheck --check-prefix=CHECK-FPA %s
Sebastian Pop422377c2012-01-20 22:01:23 +000016// RUN: %clang -target arm-linux-eabi -mfpu=maverick %s -### -o %t.o 2>&1 \
Evgeniy Stepanov48af2a92012-01-11 11:21:31 +000017// RUN: | FileCheck --check-prefix=CHECK-FPA %s
John Brawn5a589ad2015-06-05 13:34:11 +000018// CHECK-FPA: error: {{.*}} does not support '-mfpu={{fpa|fpe|fpe2|fpe3|maverick}}'
Evgeniy Stepanov48af2a92012-01-11 11:21:31 +000019
Sebastian Pop422377c2012-01-20 22:01:23 +000020// RUN: %clang -target arm-linux-eabi -mfpu=vfp %s -### -o %t.o 2>&1 \
Evgeniy Stepanov48af2a92012-01-11 11:21:31 +000021// RUN: | FileCheck --check-prefix=CHECK-VFP %s
22// CHECK-VFP: "-target-feature" "+vfp2"
John Brawn5a589ad2015-06-05 13:34:11 +000023// CHECK-VFP: "-target-feature" "-vfp3"
24// CHECK-VFP: "-target-feature" "-vfp4"
25// CHECK-VFP: "-target-feature" "-fp-armv8"
Evgeniy Stepanov48af2a92012-01-11 11:21:31 +000026// CHECK-VFP: "-target-feature" "-neon"
27
Sebastian Pop422377c2012-01-20 22:01:23 +000028// RUN: %clang -target arm-linux-eabi -mfpu=vfp3 %s -### -o %t.o 2>&1 \
Evgeniy Stepanov48af2a92012-01-11 11:21:31 +000029// RUN: | FileCheck --check-prefix=CHECK-VFP3 %s
Sebastian Pop422377c2012-01-20 22:01:23 +000030// RUN: %clang -target arm-linux-eabi -mfpu=vfpv3 %s -### -o %t.o 2>&1 \
Evgeniy Stepanov48af2a92012-01-11 11:21:31 +000031// RUN: | FileCheck --check-prefix=CHECK-VFP3 %s
32// CHECK-VFP3: "-target-feature" "+vfp3"
John Brawn5a589ad2015-06-05 13:34:11 +000033// CHECK-VFP3: "-target-feature" "-vfp4"
34// CHECK-VFP3: "-target-feature" "-fp-armv8"
Evgeniy Stepanov48af2a92012-01-11 11:21:31 +000035// CHECK-VFP3: "-target-feature" "-neon"
36
Javed Absar8f161752015-06-29 09:30:19 +000037// RUN: %clang -target arm-linux-eabi -mfpu=vfpv3-fp16 %s -### -o %t.o 2>&1 \
38// RUN: | FileCheck --check-prefix=CHECK-VFP3-FP16 %s
39// CHECK-VFP3-FP16: "-target-feature" "-fp-only-sp"
40// CHECK-VFP3-FP16: "-target-feature" "-d16"
41// CHECK-VFP3-FP16: "-target-feature" "+vfp3"
42// CHECK-VFP3-FP16: "-target-feature" "+fp16"
43// CHECK-VFP3-FP16: "-target-feature" "-vfp4"
44// CHECK-VFP3-FP16: "-target-feature" "-fp-armv8"
45// CHECK-VFP3-FP16: "-target-feature" "-neon"
46// CHECK-VFP3-FP16: "-target-feature" "-crypto"
47
Richard Barton09b60b22014-11-28 20:39:54 +000048// RUN: %clang -target arm-linux-eabi -mfpu=vfp3-d16 %s -### -o %t.o 2>&1 \
49// RUN: | FileCheck --check-prefix=CHECK-VFP3-D16 %s
50// RUN: %clang -target arm-linux-eabi -mfpu=vfpv3-d16 %s -### -o %t.o 2>&1 \
51// RUN: | FileCheck --check-prefix=CHECK-VFP3-D16 %s
John Brawn5a589ad2015-06-05 13:34:11 +000052// CHECK-VFP3-D16: "-target-feature" "-fp-only-sp"
Richard Barton09b60b22014-11-28 20:39:54 +000053// CHECK-VFP3-D16: "-target-feature" "+d16"
Renato Golin0600e1e2015-05-08 21:04:50 +000054// CHECK-VFP3-D16: "-target-feature" "+vfp3"
John Brawn5a589ad2015-06-05 13:34:11 +000055// CHECK-VFP3-D16: "-target-feature" "-vfp4"
56// CHECK-VFP3-D16: "-target-feature" "-fp-armv8"
Richard Barton09b60b22014-11-28 20:39:54 +000057// CHECK-VFP3-D16: "-target-feature" "-neon"
58
Javed Absar8f161752015-06-29 09:30:19 +000059// RUN: %clang -target arm-linux-eabi -mfpu=vfpv3-d16-fp16 %s -### -o %t.o 2>&1 \
60// RUN: | FileCheck --check-prefix=CHECK-VFP3-D16-FP16 %s
61// CHECK-VFP3-D16-FP16: "-target-feature" "-fp-only-sp"
62// CHECK-VFP3-D16-FP16: "-target-feature" "+d16"
63// CHECK-VFP3-D16-FP16: "-target-feature" "+vfp3"
64// CHECK-VFP3-D16-FP16: "-target-feature" "+fp16"
65// CHECK-VFP3-D16-FP16: "-target-feature" "-vfp4"
66// CHECK-VFP3-D16-FP16: "-target-feature" "-fp-armv8"
67// CHECK-VFP3-D16-FP16: "-target-feature" "-neon"
68// CHECK-VFP3-D16-FP16: "-target-feature" "-crypto"
69
70// RUN: %clang -target arm-linux-eabi -mfpu=vfpv3xd %s -### -o %t.o 2>&1 \
71// RUN: | FileCheck --check-prefix=CHECK-VFP3XD %s
72// CHECK-VFP3XD: "-target-feature" "+fp-only-sp"
73// CHECK-VFP3XD: "-target-feature" "+d16"
74// CHECK-VFP3XD: "-target-feature" "+vfp3"
75// CHECK-VFP3XD: "-target-feature" "-fp16"
76// CHECK-VFP3XD: "-target-feature" "-vfp4"
77// CHECK-VFP3XD: "-target-feature" "-fp-armv8"
78// CHECK-VFP3XD: "-target-feature" "-neon"
79// CHECK-VFP3XD: "-target-feature" "-crypto"
80
81// RUN: %clang -target arm-linux-eabi -mfpu=vfpv3xd-fp16 %s -### -o %t.o 2>&1 \
82// RUN: | FileCheck --check-prefix=CHECK-VFP3XD-FP16 %s
83// CHECK-VFP3XD-FP16: "-target-feature" "+fp-only-sp"
84// CHECK-VFP3XD-FP16: "-target-feature" "+d16"
85// CHECK-VFP3XD-FP16: "-target-feature" "+vfp3"
86// CHECK-VFP3XD-FP16: "-target-feature" "+fp16"
87// CHECK-VFP3XD-FP16: "-target-feature" "-vfp4"
88// CHECK-VFP3XD-FP16: "-target-feature" "-fp-armv8"
89// CHECK-VFP3XD-FP16: "-target-feature" "-neon"
90// CHECK-VFP3XD-FP16: "-target-feature" "-crypto"
91
Artyom Skrobov53b000a82013-11-21 14:04:38 +000092// RUN: %clang -target arm-linux-eabi -mfpu=vfp4 %s -### -o %t.o 2>&1 \
93// RUN: | FileCheck --check-prefix=CHECK-VFP4 %s
94// RUN: %clang -target arm-linux-eabi -mfpu=vfpv4 %s -### -o %t.o 2>&1 \
95// RUN: | FileCheck --check-prefix=CHECK-VFP4 %s
96// CHECK-VFP4: "-target-feature" "+vfp4"
John Brawn5a589ad2015-06-05 13:34:11 +000097// CHECK-VFP4: "-target-feature" "-fp-armv8"
Artyom Skrobov53b000a82013-11-21 14:04:38 +000098// CHECK-VFP4: "-target-feature" "-neon"
99
100// RUN: %clang -target arm-linux-eabi -mfpu=vfp4-d16 %s -### -o %t.o 2>&1 \
101// RUN: | FileCheck --check-prefix=CHECK-VFP4-D16 %s
102// RUN: %clang -target arm-linux-eabi -mfpu=vfpv4-d16 %s -### -o %t.o 2>&1 \
103// RUN: | FileCheck --check-prefix=CHECK-VFP4-D16 %s
John Brawn5a589ad2015-06-05 13:34:11 +0000104// CHECK-VFP4-D16: "-target-feature" "-fp-only-sp"
Artyom Skrobov53b000a82013-11-21 14:04:38 +0000105// CHECK-VFP4-D16: "-target-feature" "+d16"
Renato Golin0600e1e2015-05-08 21:04:50 +0000106// CHECK-VFP4-D16: "-target-feature" "+vfp4"
John Brawn5a589ad2015-06-05 13:34:11 +0000107// CHECK-VFP4-D16: "-target-feature" "-fp-armv8"
Artyom Skrobov53b000a82013-11-21 14:04:38 +0000108// CHECK-VFP4-D16: "-target-feature" "-neon"
109
Oliver Stannard96601ca2014-02-21 10:39:15 +0000110// RUN: %clang -target arm-linux-eabi -mfpu=fp4-sp-d16 %s -### -o %t.o 2>&1 \
111// RUN: | FileCheck --check-prefix=CHECK-FP4-SP-D16 %s
112// RUN: %clang -target arm-linux-eabi -mfpu=fpv4-sp-d16 %s -### -o %t.o 2>&1 \
113// RUN: | FileCheck --check-prefix=CHECK-FP4-SP-D16 %s
Oliver Stannard96601ca2014-02-21 10:39:15 +0000114// CHECK-FP4-SP-D16: "-target-feature" "+fp-only-sp"
Renato Golin0600e1e2015-05-08 21:04:50 +0000115// CHECK-FP4-SP-D16: "-target-feature" "+d16"
116// CHECK-FP4-SP-D16: "-target-feature" "+vfp4"
John Brawn5a589ad2015-06-05 13:34:11 +0000117// CHECK-FP4-SP-D16: "-target-feature" "-fp-armv8"
Oliver Stannard96601ca2014-02-21 10:39:15 +0000118// CHECK-FP4-SP-D16: "-target-feature" "-neon"
Artyom Skrobov53b000a82013-11-21 14:04:38 +0000119
Oliver Stannardbfd3ea32014-10-01 09:03:02 +0000120// RUN: %clang -target arm-linux-eabi -mfpu=fp5-sp-d16 %s -### -o %t.o 2>&1 \
121// RUN: | FileCheck --check-prefix=CHECK-FP5-SP-D16 %s
122// RUN: %clang -target arm-linux-eabi -mfpu=fpv5-sp-d16 %s -### -o %t.o 2>&1 \
123// RUN: | FileCheck --check-prefix=CHECK-FP5-SP-D16 %s
Oliver Stannardbfd3ea32014-10-01 09:03:02 +0000124// CHECK-FP5-SP-D16: "-target-feature" "+fp-only-sp"
125// CHECK-FP5-SP-D16: "-target-feature" "+d16"
Renato Golin0600e1e2015-05-08 21:04:50 +0000126// CHECK-FP5-SP-D16: "-target-feature" "+fp-armv8"
Oliver Stannardbfd3ea32014-10-01 09:03:02 +0000127// CHECK-FP5-SP-D16: "-target-feature" "-neon"
128// CHECK-FP5-SP-D16: "-target-feature" "-crypto"
129
130// RUN: %clang -target arm-linux-eabi -mfpu=fp5-dp-d16 %s -### -o %t.o 2>&1 \
131// RUN: | FileCheck --check-prefix=CHECK-FP5-DP-D16 %s
132// RUN: %clang -target arm-linux-eabi -mfpu=fpv5-dp-d16 %s -### -o %t.o 2>&1 \
133// RUN: | FileCheck --check-prefix=CHECK-FP5-DP-D16 %s
John Brawn5a589ad2015-06-05 13:34:11 +0000134// CHECK-FP5-DP-D16: "-target-feature" "-fp-only-sp"
Oliver Stannardbfd3ea32014-10-01 09:03:02 +0000135// CHECK-FP5-DP-D16: "-target-feature" "+d16"
Renato Golin0600e1e2015-05-08 21:04:50 +0000136// CHECK-FP5-DP-D16: "-target-feature" "+fp-armv8"
Oliver Stannardbfd3ea32014-10-01 09:03:02 +0000137// CHECK-FP5-DP-D16: "-target-feature" "-neon"
138// CHECK-FP5-DP-D16: "-target-feature" "-crypto"
139
Sebastian Pop422377c2012-01-20 22:01:23 +0000140// RUN: %clang -target arm-linux-eabi -mfpu=neon %s -### -o %t.o 2>&1 \
Evgeniy Stepanov48af2a92012-01-11 11:21:31 +0000141// RUN: | FileCheck --check-prefix=CHECK-NEON %s
142// CHECK-NEON: "-target-feature" "+neon"
143
Javed Absar8f161752015-06-29 09:30:19 +0000144// RUN: %clang -target arm-linux-eabi -mfpu=neon-fp16 %s -### -o %t.o 2>&1 \
145// RUN: | FileCheck --check-prefix=CHECK-NEON-FP16 %s
146// CHECK-NEON-FP16: "-target-feature" "-fp-only-sp"
147// CHECK-NEON-FP16: "-target-feature" "-d16"
148// CHECK-NEON-FP16: "-target-feature" "+vfp3"
149// CHECK-NEON-FP16: "-target-feature" "+fp16"
150// CHECK-NEON-FP16: "-target-feature" "-vfp4"
151// CHECK-NEON-FP16: "-target-feature" "-fp-armv8"
152// CHECK-NEON-FP16: "-target-feature" "+neon"
153// CHECK-NEON-FP16: "-target-feature" "-crypto"
154
Richard Barton3b0dcc12014-11-28 20:39:59 +0000155// RUN: %clang -target arm-linux-eabi -mfpu=neon-vfpv3 %s -### -o %t.o 2>&1 \
156// RUN: | FileCheck --check-prefix=CHECK-NEON-VFPV3 %s
Richard Barton3b0dcc12014-11-28 20:39:59 +0000157// CHECK-NEON-VFPV3: "-target-feature" "+neon"
158
Richard Barton09b60b22014-11-28 20:39:54 +0000159// RUN: %clang -target arm-linux-eabi -mfpu=neon-vfpv4 %s -### -o %t.o 2>&1 \
160// RUN: | FileCheck --check-prefix=CHECK-NEON-VFPV4 %s
Richard Barton2c5a8972014-12-18 16:31:18 +0000161// CHECK-NEON-VFPV4: "-target-feature" "+vfp4"
John Brawn5a589ad2015-06-05 13:34:11 +0000162// CHECK-NEON-VFPV4: "-target-feature" "+neon"
Richard Barton09b60b22014-11-28 20:39:54 +0000163
Sebastian Pop422377c2012-01-20 22:01:23 +0000164// RUN: %clang -target arm-linux-eabi -msoft-float %s -### -o %t.o 2>&1 \
Evgeniy Stepanova7451552012-01-11 12:36:39 +0000165// RUN: | FileCheck --check-prefix=CHECK-SOFT-FLOAT %s
166// CHECK-SOFT-FLOAT: "-target-feature" "-neon"
Joey Gouly7db275b2013-06-27 13:19:54 +0000167
Amara Emersonecbe18e2014-02-12 10:22:35 +0000168// RUN: %clang -target armv8 %s -### 2>&1 \
169// RUN: | FileCheck --check-prefix=CHECK-ARMV8-DEFAULT-SOFT-FP %s
170// CHECK-ARMV8-DEFAULT-SOFT-FP: "-target-feature" "-neon"
171// CHECK-ARMV8-DEFAULT-SOFT-FP: "-target-feature" "-crypto"
172
Bernard Ogdenda13af32013-10-24 18:32:51 +0000173// RUN: %clang -target armv8 -mfpu=fp-armv8 %s -### 2>&1 \
174// RUN: | FileCheck --check-prefix=CHECK-ARMV8-SOFT-FLOAT %s
175// CHECK-ARMV8-SOFT-FLOAT: "-target-feature" "+fp-armv8"
Bernard Ogdenda13af32013-10-24 18:32:51 +0000176// CHECK-ARMV8-SOFT-FLOAT: "-target-feature" "-neon"
Amara Emersonecbe18e2014-02-12 10:22:35 +0000177// CHECK-ARMV8-SOFT-FLOAT: "-target-feature" "-crypto"
Bernard Ogdenda13af32013-10-24 18:32:51 +0000178
Joey Gouly7db275b2013-06-27 13:19:54 +0000179// RUN: %clang -target armv8-linux-gnueabihf -mfpu=fp-armv8 %s -### 2>&1 \
180// RUN: | FileCheck --check-prefix=CHECK-FP-ARMV8 %s
Bernard Ogden18b57012013-10-29 09:47:51 +0000181// CHECK-FP-ARMV8-NOT: "-target-feature" "+neon"
Joey Goulybe8c2732013-09-13 13:48:33 +0000182// CHECK-FP-ARMV8: "-target-feature" "+fp-armv8"
Bernard Ogdenda13af32013-10-24 18:32:51 +0000183// CHECK-FP-ARMV8: "-target-feature" "-neon"
184// CHECK-FP-ARMV8: "-target-feature" "-crypto"
Joey Gouly7db275b2013-06-27 13:19:54 +0000185
186// RUN: %clang -target armv8-linux-gnueabihf -mfpu=neon-fp-armv8 %s -### 2>&1 \
187// RUN: | FileCheck --check-prefix=CHECK-NEON-FP-ARMV8 %s
Joey Goulybe8c2732013-09-13 13:48:33 +0000188// CHECK-NEON-FP-ARMV8: "-target-feature" "+fp-armv8"
Joey Gouly7db275b2013-06-27 13:19:54 +0000189// CHECK-NEON-FP-ARMV8: "-target-feature" "+neon"
Bernard Ogdenda13af32013-10-24 18:32:51 +0000190// CHECK-NEON-FP-ARMV8: "-target-feature" "-crypto"
Tim Northover244950d2013-08-20 13:19:43 +0000191
Amara Emersonfc362c62013-09-19 13:54:03 +0000192// RUN: %clang -target armv8-linux-gnueabihf -mfpu=crypto-neon-fp-armv8 %s -### 2>&1 \
193// RUN: | FileCheck --check-prefix=CHECK-CRYPTO-NEON-FP-ARMV8 %s
Amara Emersonfc362c62013-09-19 13:54:03 +0000194// CHECK-CRYPTO-NEON-FP-ARMV8: "-target-feature" "+fp-armv8"
Bernard Ogdenda13af32013-10-24 18:32:51 +0000195// CHECK-CRYPTO-NEON-FP-ARMV8: "-target-feature" "+crypto"
Amara Emersonfc362c62013-09-19 13:54:03 +0000196
Amara Emerson4cdb87b2013-10-01 10:20:54 +0000197// RUN: %clang -target armv8-linux-gnueabi -mfpu=none %s -### 2>&1 \
198// RUN: | FileCheck --check-prefix=CHECK-NO-FP %s
John Brawn5a589ad2015-06-05 13:34:11 +0000199// CHECK-NO-FP: "-target-feature" "-fp-only-sp"
200// CHECK-NO-FP: "-target-feature" "-d16"
Amara Emerson4cdb87b2013-10-01 10:20:54 +0000201// CHECK-NO-FP: "-target-feature" "-vfp2"
202// CHECK-NO-FP: "-target-feature" "-vfp3"
203// CHECK-NO-FP: "-target-feature" "-vfp4"
204// CHECK-NO-FP: "-target-feature" "-fp-armv8"
Asiri Rathnayake9e3c7cb2014-10-03 09:11:41 +0000205// CHECK-NO-FP: "-target-feature" "-neon"
John Brawn5a589ad2015-06-05 13:34:11 +0000206// CHECK-NO-FP: "-target-feature" "-crypto"
Amara Emerson4cdb87b2013-10-01 10:20:54 +0000207
Tim Northover244950d2013-08-20 13:19:43 +0000208// RUN: %clang -target arm-linux-gnueabihf %s -### 2>&1 \
209// RUN: | FileCheck --check-prefix=CHECK-HF %s
Renato Goline11531f2015-03-17 11:55:43 +0000210// CHECK-HF: "-target-cpu" "arm1176jzf-s"
Rafael Espindola9c6fb0f2013-11-23 14:36:40 +0000211
212// RUN: %clang -target armv7-apple-darwin -x assembler %s -### -c 2>&1 \
213// RUN: | FileCheck --check-prefix=ASM %s
214// ASM-NOT: -target-feature