blob: 8439cddf9d7fd4d6234543fcb2bb1ee5c47d176d [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
Richard Barton09b60b22014-11-28 20:39:54 +000037// RUN: %clang -target arm-linux-eabi -mfpu=vfp3-d16 %s -### -o %t.o 2>&1 \
38// RUN: | FileCheck --check-prefix=CHECK-VFP3-D16 %s
39// RUN: %clang -target arm-linux-eabi -mfpu=vfpv3-d16 %s -### -o %t.o 2>&1 \
40// RUN: | FileCheck --check-prefix=CHECK-VFP3-D16 %s
John Brawn5a589ad2015-06-05 13:34:11 +000041// CHECK-VFP3-D16: "-target-feature" "-fp-only-sp"
Richard Barton09b60b22014-11-28 20:39:54 +000042// CHECK-VFP3-D16: "-target-feature" "+d16"
Renato Golin0600e1e2015-05-08 21:04:50 +000043// CHECK-VFP3-D16: "-target-feature" "+vfp3"
John Brawn5a589ad2015-06-05 13:34:11 +000044// CHECK-VFP3-D16: "-target-feature" "-vfp4"
45// CHECK-VFP3-D16: "-target-feature" "-fp-armv8"
Richard Barton09b60b22014-11-28 20:39:54 +000046// CHECK-VFP3-D16: "-target-feature" "-neon"
47
Artyom Skrobov53b000a82013-11-21 14:04:38 +000048// RUN: %clang -target arm-linux-eabi -mfpu=vfp4 %s -### -o %t.o 2>&1 \
49// RUN: | FileCheck --check-prefix=CHECK-VFP4 %s
50// RUN: %clang -target arm-linux-eabi -mfpu=vfpv4 %s -### -o %t.o 2>&1 \
51// RUN: | FileCheck --check-prefix=CHECK-VFP4 %s
52// CHECK-VFP4: "-target-feature" "+vfp4"
John Brawn5a589ad2015-06-05 13:34:11 +000053// CHECK-VFP4: "-target-feature" "-fp-armv8"
Artyom Skrobov53b000a82013-11-21 14:04:38 +000054// CHECK-VFP4: "-target-feature" "-neon"
55
56// RUN: %clang -target arm-linux-eabi -mfpu=vfp4-d16 %s -### -o %t.o 2>&1 \
57// RUN: | FileCheck --check-prefix=CHECK-VFP4-D16 %s
58// RUN: %clang -target arm-linux-eabi -mfpu=vfpv4-d16 %s -### -o %t.o 2>&1 \
59// RUN: | FileCheck --check-prefix=CHECK-VFP4-D16 %s
John Brawn5a589ad2015-06-05 13:34:11 +000060// CHECK-VFP4-D16: "-target-feature" "-fp-only-sp"
Artyom Skrobov53b000a82013-11-21 14:04:38 +000061// CHECK-VFP4-D16: "-target-feature" "+d16"
Renato Golin0600e1e2015-05-08 21:04:50 +000062// CHECK-VFP4-D16: "-target-feature" "+vfp4"
John Brawn5a589ad2015-06-05 13:34:11 +000063// CHECK-VFP4-D16: "-target-feature" "-fp-armv8"
Artyom Skrobov53b000a82013-11-21 14:04:38 +000064// CHECK-VFP4-D16: "-target-feature" "-neon"
65
Oliver Stannard96601ca2014-02-21 10:39:15 +000066// RUN: %clang -target arm-linux-eabi -mfpu=fp4-sp-d16 %s -### -o %t.o 2>&1 \
67// RUN: | FileCheck --check-prefix=CHECK-FP4-SP-D16 %s
68// RUN: %clang -target arm-linux-eabi -mfpu=fpv4-sp-d16 %s -### -o %t.o 2>&1 \
69// RUN: | FileCheck --check-prefix=CHECK-FP4-SP-D16 %s
Oliver Stannard96601ca2014-02-21 10:39:15 +000070// CHECK-FP4-SP-D16: "-target-feature" "+fp-only-sp"
Renato Golin0600e1e2015-05-08 21:04:50 +000071// CHECK-FP4-SP-D16: "-target-feature" "+d16"
72// CHECK-FP4-SP-D16: "-target-feature" "+vfp4"
John Brawn5a589ad2015-06-05 13:34:11 +000073// CHECK-FP4-SP-D16: "-target-feature" "-fp-armv8"
Oliver Stannard96601ca2014-02-21 10:39:15 +000074// CHECK-FP4-SP-D16: "-target-feature" "-neon"
Artyom Skrobov53b000a82013-11-21 14:04:38 +000075
Oliver Stannardbfd3ea32014-10-01 09:03:02 +000076// RUN: %clang -target arm-linux-eabi -mfpu=fp5-sp-d16 %s -### -o %t.o 2>&1 \
77// RUN: | FileCheck --check-prefix=CHECK-FP5-SP-D16 %s
78// RUN: %clang -target arm-linux-eabi -mfpu=fpv5-sp-d16 %s -### -o %t.o 2>&1 \
79// RUN: | FileCheck --check-prefix=CHECK-FP5-SP-D16 %s
Oliver Stannardbfd3ea32014-10-01 09:03:02 +000080// CHECK-FP5-SP-D16: "-target-feature" "+fp-only-sp"
81// CHECK-FP5-SP-D16: "-target-feature" "+d16"
Renato Golin0600e1e2015-05-08 21:04:50 +000082// CHECK-FP5-SP-D16: "-target-feature" "+fp-armv8"
Oliver Stannardbfd3ea32014-10-01 09:03:02 +000083// CHECK-FP5-SP-D16: "-target-feature" "-neon"
84// CHECK-FP5-SP-D16: "-target-feature" "-crypto"
85
86// RUN: %clang -target arm-linux-eabi -mfpu=fp5-dp-d16 %s -### -o %t.o 2>&1 \
87// RUN: | FileCheck --check-prefix=CHECK-FP5-DP-D16 %s
88// RUN: %clang -target arm-linux-eabi -mfpu=fpv5-dp-d16 %s -### -o %t.o 2>&1 \
89// RUN: | FileCheck --check-prefix=CHECK-FP5-DP-D16 %s
John Brawn5a589ad2015-06-05 13:34:11 +000090// CHECK-FP5-DP-D16: "-target-feature" "-fp-only-sp"
Oliver Stannardbfd3ea32014-10-01 09:03:02 +000091// CHECK-FP5-DP-D16: "-target-feature" "+d16"
Renato Golin0600e1e2015-05-08 21:04:50 +000092// CHECK-FP5-DP-D16: "-target-feature" "+fp-armv8"
Oliver Stannardbfd3ea32014-10-01 09:03:02 +000093// CHECK-FP5-DP-D16: "-target-feature" "-neon"
94// CHECK-FP5-DP-D16: "-target-feature" "-crypto"
95
Sebastian Pop422377c2012-01-20 22:01:23 +000096// RUN: %clang -target arm-linux-eabi -mfpu=neon %s -### -o %t.o 2>&1 \
Evgeniy Stepanov48af2a92012-01-11 11:21:31 +000097// RUN: | FileCheck --check-prefix=CHECK-NEON %s
98// CHECK-NEON: "-target-feature" "+neon"
99
Richard Barton3b0dcc12014-11-28 20:39:59 +0000100// RUN: %clang -target arm-linux-eabi -mfpu=neon-vfpv3 %s -### -o %t.o 2>&1 \
101// RUN: | FileCheck --check-prefix=CHECK-NEON-VFPV3 %s
Richard Barton3b0dcc12014-11-28 20:39:59 +0000102// CHECK-NEON-VFPV3: "-target-feature" "+neon"
103
Richard Barton09b60b22014-11-28 20:39:54 +0000104// RUN: %clang -target arm-linux-eabi -mfpu=neon-vfpv4 %s -### -o %t.o 2>&1 \
105// RUN: | FileCheck --check-prefix=CHECK-NEON-VFPV4 %s
Richard Barton2c5a8972014-12-18 16:31:18 +0000106// CHECK-NEON-VFPV4: "-target-feature" "+vfp4"
John Brawn5a589ad2015-06-05 13:34:11 +0000107// CHECK-NEON-VFPV4: "-target-feature" "+neon"
Richard Barton09b60b22014-11-28 20:39:54 +0000108
Sebastian Pop422377c2012-01-20 22:01:23 +0000109// RUN: %clang -target arm-linux-eabi -msoft-float %s -### -o %t.o 2>&1 \
Evgeniy Stepanova7451552012-01-11 12:36:39 +0000110// RUN: | FileCheck --check-prefix=CHECK-SOFT-FLOAT %s
111// CHECK-SOFT-FLOAT: "-target-feature" "-neon"
Joey Gouly7db275b2013-06-27 13:19:54 +0000112
Amara Emersonecbe18e2014-02-12 10:22:35 +0000113// RUN: %clang -target armv8 %s -### 2>&1 \
114// RUN: | FileCheck --check-prefix=CHECK-ARMV8-DEFAULT-SOFT-FP %s
115// CHECK-ARMV8-DEFAULT-SOFT-FP: "-target-feature" "-neon"
116// CHECK-ARMV8-DEFAULT-SOFT-FP: "-target-feature" "-crypto"
117
Bernard Ogdenda13af32013-10-24 18:32:51 +0000118// RUN: %clang -target armv8 -mfpu=fp-armv8 %s -### 2>&1 \
119// RUN: | FileCheck --check-prefix=CHECK-ARMV8-SOFT-FLOAT %s
120// CHECK-ARMV8-SOFT-FLOAT: "-target-feature" "+fp-armv8"
Bernard Ogdenda13af32013-10-24 18:32:51 +0000121// CHECK-ARMV8-SOFT-FLOAT: "-target-feature" "-neon"
Amara Emersonecbe18e2014-02-12 10:22:35 +0000122// CHECK-ARMV8-SOFT-FLOAT: "-target-feature" "-crypto"
Bernard Ogdenda13af32013-10-24 18:32:51 +0000123
Joey Gouly7db275b2013-06-27 13:19:54 +0000124// RUN: %clang -target armv8-linux-gnueabihf -mfpu=fp-armv8 %s -### 2>&1 \
125// RUN: | FileCheck --check-prefix=CHECK-FP-ARMV8 %s
Bernard Ogden18b57012013-10-29 09:47:51 +0000126// CHECK-FP-ARMV8-NOT: "-target-feature" "+neon"
Joey Goulybe8c2732013-09-13 13:48:33 +0000127// CHECK-FP-ARMV8: "-target-feature" "+fp-armv8"
Bernard Ogdenda13af32013-10-24 18:32:51 +0000128// CHECK-FP-ARMV8: "-target-feature" "-neon"
129// CHECK-FP-ARMV8: "-target-feature" "-crypto"
Joey Gouly7db275b2013-06-27 13:19:54 +0000130
131// RUN: %clang -target armv8-linux-gnueabihf -mfpu=neon-fp-armv8 %s -### 2>&1 \
132// RUN: | FileCheck --check-prefix=CHECK-NEON-FP-ARMV8 %s
Joey Goulybe8c2732013-09-13 13:48:33 +0000133// CHECK-NEON-FP-ARMV8: "-target-feature" "+fp-armv8"
Joey Gouly7db275b2013-06-27 13:19:54 +0000134// CHECK-NEON-FP-ARMV8: "-target-feature" "+neon"
Bernard Ogdenda13af32013-10-24 18:32:51 +0000135// CHECK-NEON-FP-ARMV8: "-target-feature" "-crypto"
Tim Northover244950d2013-08-20 13:19:43 +0000136
Amara Emersonfc362c62013-09-19 13:54:03 +0000137// RUN: %clang -target armv8-linux-gnueabihf -mfpu=crypto-neon-fp-armv8 %s -### 2>&1 \
138// RUN: | FileCheck --check-prefix=CHECK-CRYPTO-NEON-FP-ARMV8 %s
Amara Emersonfc362c62013-09-19 13:54:03 +0000139// CHECK-CRYPTO-NEON-FP-ARMV8: "-target-feature" "+fp-armv8"
Bernard Ogdenda13af32013-10-24 18:32:51 +0000140// CHECK-CRYPTO-NEON-FP-ARMV8: "-target-feature" "+crypto"
Amara Emersonfc362c62013-09-19 13:54:03 +0000141
Amara Emerson4cdb87b2013-10-01 10:20:54 +0000142// RUN: %clang -target armv8-linux-gnueabi -mfpu=none %s -### 2>&1 \
143// RUN: | FileCheck --check-prefix=CHECK-NO-FP %s
John Brawn5a589ad2015-06-05 13:34:11 +0000144// CHECK-NO-FP: "-target-feature" "-fp-only-sp"
145// CHECK-NO-FP: "-target-feature" "-d16"
Amara Emerson4cdb87b2013-10-01 10:20:54 +0000146// CHECK-NO-FP: "-target-feature" "-vfp2"
147// CHECK-NO-FP: "-target-feature" "-vfp3"
148// CHECK-NO-FP: "-target-feature" "-vfp4"
149// CHECK-NO-FP: "-target-feature" "-fp-armv8"
Asiri Rathnayake9e3c7cb2014-10-03 09:11:41 +0000150// CHECK-NO-FP: "-target-feature" "-neon"
John Brawn5a589ad2015-06-05 13:34:11 +0000151// CHECK-NO-FP: "-target-feature" "-crypto"
Amara Emerson4cdb87b2013-10-01 10:20:54 +0000152
Tim Northover244950d2013-08-20 13:19:43 +0000153// RUN: %clang -target arm-linux-gnueabihf %s -### 2>&1 \
154// RUN: | FileCheck --check-prefix=CHECK-HF %s
Renato Goline11531f2015-03-17 11:55:43 +0000155// CHECK-HF: "-target-cpu" "arm1176jzf-s"
Rafael Espindola9c6fb0f2013-11-23 14:36:40 +0000156
157// RUN: %clang -target armv7-apple-darwin -x assembler %s -### -c 2>&1 \
158// RUN: | FileCheck --check-prefix=ASM %s
159// ASM-NOT: -target-feature