blob: 765b2982156af4fe3bf21251ae3bb5bf3f6cd4fd [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=vfp3-d16 %s -### -o %t.o 2>&1 \
Evgeniy Stepanov48af2a92012-01-11 11:21:31 +000023// RUN: | FileCheck --check-prefix=CHECK-VFP3-D16 %s
Sebastian Pop422377c2012-01-20 22:01:23 +000024// RUN: %clang -target arm-linux-eabi -mfpu=vfpv3-d16 %s -### -o %t.o 2>&1 \
Evgeniy Stepanov48af2a92012-01-11 11:21:31 +000025// RUN: | FileCheck --check-prefix=CHECK-VFP3-D16 %s
26// CHECK-VFP3-D16: "-target-feature" "+vfp3"
27// CHECK-VFP3-D16: "-target-feature" "+d16"
28// CHECK-VFP3-D16: "-target-feature" "-neon"
29
Sebastian Pop422377c2012-01-20 22:01:23 +000030// RUN: %clang -target arm-linux-eabi -mfpu=vfp %s -### -o %t.o 2>&1 \
Evgeniy Stepanov48af2a92012-01-11 11:21:31 +000031// RUN: | FileCheck --check-prefix=CHECK-VFP %s
32// CHECK-VFP: "-target-feature" "+vfp2"
33// CHECK-VFP: "-target-feature" "-neon"
34
Sebastian Pop422377c2012-01-20 22:01:23 +000035// RUN: %clang -target arm-linux-eabi -mfpu=vfp3 %s -### -o %t.o 2>&1 \
Evgeniy Stepanov48af2a92012-01-11 11:21:31 +000036// RUN: | FileCheck --check-prefix=CHECK-VFP3 %s
Sebastian Pop422377c2012-01-20 22:01:23 +000037// RUN: %clang -target arm-linux-eabi -mfpu=vfpv3 %s -### -o %t.o 2>&1 \
Evgeniy Stepanov48af2a92012-01-11 11:21:31 +000038// RUN: | FileCheck --check-prefix=CHECK-VFP3 %s
39// CHECK-VFP3: "-target-feature" "+vfp3"
40// CHECK-VFP3: "-target-feature" "-neon"
41
Sebastian Pop422377c2012-01-20 22:01:23 +000042// RUN: %clang -target arm-linux-eabi -mfpu=neon %s -### -o %t.o 2>&1 \
Evgeniy Stepanov48af2a92012-01-11 11:21:31 +000043// RUN: | FileCheck --check-prefix=CHECK-NEON %s
44// CHECK-NEON: "-target-feature" "+neon"
45
Sebastian Pop422377c2012-01-20 22:01:23 +000046// RUN: %clang -target arm-linux-eabi -msoft-float %s -### -o %t.o 2>&1 \
Evgeniy Stepanova7451552012-01-11 12:36:39 +000047// RUN: | FileCheck --check-prefix=CHECK-SOFT-FLOAT %s
48// CHECK-SOFT-FLOAT: "-target-feature" "-neon"
Joey Gouly7db275b2013-06-27 13:19:54 +000049
Bernard Ogdenda13af32013-10-24 18:32:51 +000050// RUN: %clang -target armv8 -mfpu=fp-armv8 %s -### 2>&1 \
51// RUN: | FileCheck --check-prefix=CHECK-ARMV8-SOFT-FLOAT %s
52// CHECK-ARMV8-SOFT-FLOAT: "-target-feature" "+fp-armv8"
53// CHECK-ARMV8-SOFT-FLOAT: "-target-feature" "-crypto"
54// CHECK-ARMV8-SOFT-FLOAT: "-target-feature" "-neon"
55
Joey Gouly7db275b2013-06-27 13:19:54 +000056// RUN: %clang -target armv8-linux-gnueabihf -mfpu=fp-armv8 %s -### 2>&1 \
57// RUN: | FileCheck --check-prefix=CHECK-FP-ARMV8 %s
Bernard Ogden18b57012013-10-29 09:47:51 +000058// CHECK-FP-ARMV8-NOT: "-target-feature" "+neon"
Joey Goulybe8c2732013-09-13 13:48:33 +000059// CHECK-FP-ARMV8: "-target-feature" "+fp-armv8"
Bernard Ogdenda13af32013-10-24 18:32:51 +000060// CHECK-FP-ARMV8: "-target-feature" "-neon"
61// CHECK-FP-ARMV8: "-target-feature" "-crypto"
Joey Gouly7db275b2013-06-27 13:19:54 +000062
63// RUN: %clang -target armv8-linux-gnueabihf -mfpu=neon-fp-armv8 %s -### 2>&1 \
64// RUN: | FileCheck --check-prefix=CHECK-NEON-FP-ARMV8 %s
Joey Goulybe8c2732013-09-13 13:48:33 +000065// CHECK-NEON-FP-ARMV8: "-target-feature" "+fp-armv8"
Joey Gouly7db275b2013-06-27 13:19:54 +000066// CHECK-NEON-FP-ARMV8: "-target-feature" "+neon"
Bernard Ogdenda13af32013-10-24 18:32:51 +000067// CHECK-NEON-FP-ARMV8: "-target-feature" "-crypto"
Tim Northover244950d2013-08-20 13:19:43 +000068
Amara Emersonfc362c62013-09-19 13:54:03 +000069// RUN: %clang -target armv8-linux-gnueabihf -mfpu=crypto-neon-fp-armv8 %s -### 2>&1 \
70// RUN: | FileCheck --check-prefix=CHECK-CRYPTO-NEON-FP-ARMV8 %s
Amara Emersonfc362c62013-09-19 13:54:03 +000071// CHECK-CRYPTO-NEON-FP-ARMV8: "-target-feature" "+fp-armv8"
Bernard Ogdenda13af32013-10-24 18:32:51 +000072// CHECK-CRYPTO-NEON-FP-ARMV8: "-target-feature" "+neon"
73// CHECK-CRYPTO-NEON-FP-ARMV8: "-target-feature" "+crypto"
Amara Emersonfc362c62013-09-19 13:54:03 +000074
Amara Emerson4cdb87b2013-10-01 10:20:54 +000075// RUN: %clang -target armv8-linux-gnueabi -mfpu=none %s -### 2>&1 \
76// RUN: | FileCheck --check-prefix=CHECK-NO-FP %s
77// CHECK-NO-FP: "-target-feature" "-vfp2"
78// CHECK-NO-FP: "-target-feature" "-vfp3"
79// CHECK-NO-FP: "-target-feature" "-vfp4"
80// CHECK-NO-FP: "-target-feature" "-fp-armv8"
81// CHECK-NO-FP: "-target-feature" "-crypto"
82// CHECK-NO-FP: "-target-feature" "-neon"
83
Tim Northover244950d2013-08-20 13:19:43 +000084// RUN: %clang -target arm-linux-gnueabihf %s -### 2>&1 \
85// RUN: | FileCheck --check-prefix=CHECK-HF %s
86// CHECK-HF: "-target-cpu" "arm1136jf-s"