blob: d941a3c9af06f8d60d0a81ab2fa1a978443948b2 [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
18// CHECK-FPA: "-target-feature" "-vfp2"
19// CHECK-FPA: "-target-feature" "-vfp3"
20// CHECK-FPA: "-target-feature" "-neon"
21
Sebastian Pop422377c2012-01-20 22:01:23 +000022// RUN: %clang -target arm-linux-eabi -mfpu=vfp %s -### -o %t.o 2>&1 \
Evgeniy Stepanov48af2a92012-01-11 11:21:31 +000023// RUN: | FileCheck --check-prefix=CHECK-VFP %s
24// CHECK-VFP: "-target-feature" "+vfp2"
25// CHECK-VFP: "-target-feature" "-neon"
26
Sebastian Pop422377c2012-01-20 22:01:23 +000027// RUN: %clang -target arm-linux-eabi -mfpu=vfp3 %s -### -o %t.o 2>&1 \
Evgeniy Stepanov48af2a92012-01-11 11:21:31 +000028// RUN: | FileCheck --check-prefix=CHECK-VFP3 %s
Sebastian Pop422377c2012-01-20 22:01:23 +000029// RUN: %clang -target arm-linux-eabi -mfpu=vfpv3 %s -### -o %t.o 2>&1 \
Evgeniy Stepanov48af2a92012-01-11 11:21:31 +000030// RUN: | FileCheck --check-prefix=CHECK-VFP3 %s
31// CHECK-VFP3: "-target-feature" "+vfp3"
32// CHECK-VFP3: "-target-feature" "-neon"
33
Richard Barton09b60b22014-11-28 20:39:54 +000034// RUN: %clang -target arm-linux-eabi -mfpu=vfp3-d16 %s -### -o %t.o 2>&1 \
35// RUN: | FileCheck --check-prefix=CHECK-VFP3-D16 %s
36// RUN: %clang -target arm-linux-eabi -mfpu=vfpv3-d16 %s -### -o %t.o 2>&1 \
37// RUN: | FileCheck --check-prefix=CHECK-VFP3-D16 %s
Richard Barton09b60b22014-11-28 20:39:54 +000038// CHECK-VFP3-D16: "-target-feature" "+d16"
Renato Golin0600e1e2015-05-08 21:04:50 +000039// CHECK-VFP3-D16: "-target-feature" "+vfp3"
Richard Barton09b60b22014-11-28 20:39:54 +000040// CHECK-VFP3-D16: "-target-feature" "-neon"
41
Artyom Skrobov53b000a82013-11-21 14:04:38 +000042// RUN: %clang -target arm-linux-eabi -mfpu=vfp4 %s -### -o %t.o 2>&1 \
43// RUN: | FileCheck --check-prefix=CHECK-VFP4 %s
44// RUN: %clang -target arm-linux-eabi -mfpu=vfpv4 %s -### -o %t.o 2>&1 \
45// RUN: | FileCheck --check-prefix=CHECK-VFP4 %s
46// CHECK-VFP4: "-target-feature" "+vfp4"
47// CHECK-VFP4: "-target-feature" "-neon"
48
49// RUN: %clang -target arm-linux-eabi -mfpu=vfp4-d16 %s -### -o %t.o 2>&1 \
50// RUN: | FileCheck --check-prefix=CHECK-VFP4-D16 %s
51// RUN: %clang -target arm-linux-eabi -mfpu=vfpv4-d16 %s -### -o %t.o 2>&1 \
52// RUN: | FileCheck --check-prefix=CHECK-VFP4-D16 %s
Artyom Skrobov53b000a82013-11-21 14:04:38 +000053// CHECK-VFP4-D16: "-target-feature" "+d16"
Renato Golin0600e1e2015-05-08 21:04:50 +000054// CHECK-VFP4-D16: "-target-feature" "+vfp4"
Artyom Skrobov53b000a82013-11-21 14:04:38 +000055// CHECK-VFP4-D16: "-target-feature" "-neon"
56
Oliver Stannard96601ca2014-02-21 10:39:15 +000057// RUN: %clang -target arm-linux-eabi -mfpu=fp4-sp-d16 %s -### -o %t.o 2>&1 \
58// RUN: | FileCheck --check-prefix=CHECK-FP4-SP-D16 %s
59// RUN: %clang -target arm-linux-eabi -mfpu=fpv4-sp-d16 %s -### -o %t.o 2>&1 \
60// RUN: | FileCheck --check-prefix=CHECK-FP4-SP-D16 %s
Oliver Stannard96601ca2014-02-21 10:39:15 +000061// CHECK-FP4-SP-D16: "-target-feature" "+fp-only-sp"
Renato Golin0600e1e2015-05-08 21:04:50 +000062// CHECK-FP4-SP-D16: "-target-feature" "+d16"
63// CHECK-FP4-SP-D16: "-target-feature" "+vfp4"
Oliver Stannard96601ca2014-02-21 10:39:15 +000064// CHECK-FP4-SP-D16: "-target-feature" "-neon"
Artyom Skrobov53b000a82013-11-21 14:04:38 +000065
Oliver Stannardbfd3ea32014-10-01 09:03:02 +000066// RUN: %clang -target arm-linux-eabi -mfpu=fp5-sp-d16 %s -### -o %t.o 2>&1 \
67// RUN: | FileCheck --check-prefix=CHECK-FP5-SP-D16 %s
68// RUN: %clang -target arm-linux-eabi -mfpu=fpv5-sp-d16 %s -### -o %t.o 2>&1 \
69// RUN: | FileCheck --check-prefix=CHECK-FP5-SP-D16 %s
Oliver Stannardbfd3ea32014-10-01 09:03:02 +000070// CHECK-FP5-SP-D16: "-target-feature" "+fp-only-sp"
71// CHECK-FP5-SP-D16: "-target-feature" "+d16"
Renato Golin0600e1e2015-05-08 21:04:50 +000072// CHECK-FP5-SP-D16: "-target-feature" "+fp-armv8"
Oliver Stannardbfd3ea32014-10-01 09:03:02 +000073// CHECK-FP5-SP-D16: "-target-feature" "-neon"
74// CHECK-FP5-SP-D16: "-target-feature" "-crypto"
75
76// RUN: %clang -target arm-linux-eabi -mfpu=fp5-dp-d16 %s -### -o %t.o 2>&1 \
77// RUN: | FileCheck --check-prefix=CHECK-FP5-DP-D16 %s
78// RUN: %clang -target arm-linux-eabi -mfpu=fpv5-dp-d16 %s -### -o %t.o 2>&1 \
79// RUN: | FileCheck --check-prefix=CHECK-FP5-DP-D16 %s
Oliver Stannardbfd3ea32014-10-01 09:03:02 +000080// CHECK-FP5-DP-D16: "-target-feature" "+d16"
Renato Golin0600e1e2015-05-08 21:04:50 +000081// CHECK-FP5-DP-D16: "-target-feature" "+fp-armv8"
Oliver Stannardbfd3ea32014-10-01 09:03:02 +000082// CHECK-FP5-DP-D16: "-target-feature" "-neon"
83// CHECK-FP5-DP-D16: "-target-feature" "-crypto"
84
Sebastian Pop422377c2012-01-20 22:01:23 +000085// RUN: %clang -target arm-linux-eabi -mfpu=neon %s -### -o %t.o 2>&1 \
Evgeniy Stepanov48af2a92012-01-11 11:21:31 +000086// RUN: | FileCheck --check-prefix=CHECK-NEON %s
87// CHECK-NEON: "-target-feature" "+neon"
88
Richard Barton3b0dcc12014-11-28 20:39:59 +000089// RUN: %clang -target arm-linux-eabi -mfpu=neon-vfpv3 %s -### -o %t.o 2>&1 \
90// RUN: | FileCheck --check-prefix=CHECK-NEON-VFPV3 %s
Richard Barton3b0dcc12014-11-28 20:39:59 +000091// CHECK-NEON-VFPV3: "-target-feature" "+neon"
92
Richard Barton09b60b22014-11-28 20:39:54 +000093// RUN: %clang -target arm-linux-eabi -mfpu=neon-vfpv4 %s -### -o %t.o 2>&1 \
94// RUN: | FileCheck --check-prefix=CHECK-NEON-VFPV4 %s
95// CHECK-NEON-VFPV4: "-target-feature" "+neon"
Richard Barton2c5a8972014-12-18 16:31:18 +000096// CHECK-NEON-VFPV4: "-target-feature" "+vfp4"
Richard Barton09b60b22014-11-28 20:39:54 +000097
Sebastian Pop422377c2012-01-20 22:01:23 +000098// RUN: %clang -target arm-linux-eabi -msoft-float %s -### -o %t.o 2>&1 \
Evgeniy Stepanova7451552012-01-11 12:36:39 +000099// RUN: | FileCheck --check-prefix=CHECK-SOFT-FLOAT %s
100// CHECK-SOFT-FLOAT: "-target-feature" "-neon"
Joey Gouly7db275b2013-06-27 13:19:54 +0000101
Amara Emersonecbe18e2014-02-12 10:22:35 +0000102// RUN: %clang -target armv8 %s -### 2>&1 \
103// RUN: | FileCheck --check-prefix=CHECK-ARMV8-DEFAULT-SOFT-FP %s
104// CHECK-ARMV8-DEFAULT-SOFT-FP: "-target-feature" "-neon"
105// CHECK-ARMV8-DEFAULT-SOFT-FP: "-target-feature" "-crypto"
106
Bernard Ogdenda13af32013-10-24 18:32:51 +0000107// RUN: %clang -target armv8 -mfpu=fp-armv8 %s -### 2>&1 \
108// RUN: | FileCheck --check-prefix=CHECK-ARMV8-SOFT-FLOAT %s
109// CHECK-ARMV8-SOFT-FLOAT: "-target-feature" "+fp-armv8"
Bernard Ogdenda13af32013-10-24 18:32:51 +0000110// CHECK-ARMV8-SOFT-FLOAT: "-target-feature" "-neon"
Amara Emersonecbe18e2014-02-12 10:22:35 +0000111// CHECK-ARMV8-SOFT-FLOAT: "-target-feature" "-crypto"
Bernard Ogdenda13af32013-10-24 18:32:51 +0000112
Joey Gouly7db275b2013-06-27 13:19:54 +0000113// RUN: %clang -target armv8-linux-gnueabihf -mfpu=fp-armv8 %s -### 2>&1 \
114// RUN: | FileCheck --check-prefix=CHECK-FP-ARMV8 %s
Bernard Ogden18b57012013-10-29 09:47:51 +0000115// CHECK-FP-ARMV8-NOT: "-target-feature" "+neon"
Joey Goulybe8c2732013-09-13 13:48:33 +0000116// CHECK-FP-ARMV8: "-target-feature" "+fp-armv8"
Bernard Ogdenda13af32013-10-24 18:32:51 +0000117// CHECK-FP-ARMV8: "-target-feature" "-neon"
118// CHECK-FP-ARMV8: "-target-feature" "-crypto"
Joey Gouly7db275b2013-06-27 13:19:54 +0000119
120// RUN: %clang -target armv8-linux-gnueabihf -mfpu=neon-fp-armv8 %s -### 2>&1 \
121// RUN: | FileCheck --check-prefix=CHECK-NEON-FP-ARMV8 %s
Joey Goulybe8c2732013-09-13 13:48:33 +0000122// CHECK-NEON-FP-ARMV8: "-target-feature" "+fp-armv8"
Joey Gouly7db275b2013-06-27 13:19:54 +0000123// CHECK-NEON-FP-ARMV8: "-target-feature" "+neon"
Bernard Ogdenda13af32013-10-24 18:32:51 +0000124// CHECK-NEON-FP-ARMV8: "-target-feature" "-crypto"
Tim Northover244950d2013-08-20 13:19:43 +0000125
Amara Emersonfc362c62013-09-19 13:54:03 +0000126// RUN: %clang -target armv8-linux-gnueabihf -mfpu=crypto-neon-fp-armv8 %s -### 2>&1 \
127// RUN: | FileCheck --check-prefix=CHECK-CRYPTO-NEON-FP-ARMV8 %s
Amara Emersonfc362c62013-09-19 13:54:03 +0000128// CHECK-CRYPTO-NEON-FP-ARMV8: "-target-feature" "+fp-armv8"
Bernard Ogdenda13af32013-10-24 18:32:51 +0000129// CHECK-CRYPTO-NEON-FP-ARMV8: "-target-feature" "+neon"
130// CHECK-CRYPTO-NEON-FP-ARMV8: "-target-feature" "+crypto"
Amara Emersonfc362c62013-09-19 13:54:03 +0000131
Amara Emerson4cdb87b2013-10-01 10:20:54 +0000132// RUN: %clang -target armv8-linux-gnueabi -mfpu=none %s -### 2>&1 \
133// RUN: | FileCheck --check-prefix=CHECK-NO-FP %s
134// CHECK-NO-FP: "-target-feature" "-vfp2"
135// CHECK-NO-FP: "-target-feature" "-vfp3"
136// CHECK-NO-FP: "-target-feature" "-vfp4"
137// CHECK-NO-FP: "-target-feature" "-fp-armv8"
Asiri Rathnayake9e3c7cb2014-10-03 09:11:41 +0000138// CHECK-NO-FP: "-target-feature" "-crypto"
139// CHECK-NO-FP: "-target-feature" "-neon"
Amara Emerson4cdb87b2013-10-01 10:20:54 +0000140
Tim Northover244950d2013-08-20 13:19:43 +0000141// RUN: %clang -target arm-linux-gnueabihf %s -### 2>&1 \
142// RUN: | FileCheck --check-prefix=CHECK-HF %s
Renato Goline11531f2015-03-17 11:55:43 +0000143// CHECK-HF: "-target-cpu" "arm1176jzf-s"
Rafael Espindola9c6fb0f2013-11-23 14:36:40 +0000144
145// RUN: %clang -target armv7-apple-darwin -x assembler %s -### -c 2>&1 \
146// RUN: | FileCheck --check-prefix=ASM %s
147// ASM-NOT: -target-feature