xref: /minix3/external/bsd/llvm/dist/clang/test/Driver/arm-mfpu.c (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1f4a2713aSLionel Sambuc // Test that different values of -mfpu pick correct ARM FPU target-feature(s).
2f4a2713aSLionel Sambuc 
3f4a2713aSLionel Sambuc // RUN: %clang -target arm-linux-eabi %s -### -o %t.o 2>&1 \
4f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-DEFAULT %s
5f4a2713aSLionel Sambuc // CHECK-DEFAULT-NOT: "-target-feature" "+vfp2"
6f4a2713aSLionel Sambuc // CHECK-DEFAULT-NOT: "-target-feature" "+vfp3"
7f4a2713aSLionel Sambuc // CHECK-DEFAULT-NOT: "-target-feature" "+d16"
8f4a2713aSLionel Sambuc // CHECK-DEFAULT-NOT: "-target-feature" "+neon"
9f4a2713aSLionel Sambuc 
10f4a2713aSLionel Sambuc // RUN: %clang -target arm-linux-eabi -mfpu=fpa %s -### -o %t.o 2>&1 \
11f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-FPA %s
12f4a2713aSLionel Sambuc // RUN: %clang -target arm-linux-eabi -mfpu=fpe2 %s -### -o %t.o 2>&1 \
13f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-FPA %s
14f4a2713aSLionel Sambuc // RUN: %clang -target arm-linux-eabi -mfpu=fpe3 %s -### -o %t.o 2>&1 \
15f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-FPA %s
16f4a2713aSLionel Sambuc // RUN: %clang -target arm-linux-eabi -mfpu=maverick %s -### -o %t.o 2>&1 \
17f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-FPA %s
18f4a2713aSLionel Sambuc // CHECK-FPA: "-target-feature" "-vfp2"
19f4a2713aSLionel Sambuc // CHECK-FPA: "-target-feature" "-vfp3"
20f4a2713aSLionel Sambuc // CHECK-FPA: "-target-feature" "-neon"
21f4a2713aSLionel Sambuc 
22f4a2713aSLionel Sambuc // RUN: %clang -target arm-linux-eabi -mfpu=vfp %s -### -o %t.o 2>&1 \
23f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-VFP %s
24f4a2713aSLionel Sambuc // CHECK-VFP: "-target-feature" "+vfp2"
25f4a2713aSLionel Sambuc // CHECK-VFP: "-target-feature" "-neon"
26f4a2713aSLionel Sambuc 
27f4a2713aSLionel Sambuc // RUN: %clang -target arm-linux-eabi -mfpu=vfp3 %s -### -o %t.o 2>&1 \
28f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-VFP3 %s
29f4a2713aSLionel Sambuc // RUN: %clang -target arm-linux-eabi -mfpu=vfpv3 %s -### -o %t.o 2>&1 \
30f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-VFP3 %s
31f4a2713aSLionel Sambuc // CHECK-VFP3: "-target-feature" "+vfp3"
32f4a2713aSLionel Sambuc // CHECK-VFP3: "-target-feature" "-neon"
33f4a2713aSLionel Sambuc 
34*0a6a1f1dSLionel Sambuc // RUN: %clang -target arm-linux-eabi -mfpu=vfp3-d16 %s -### -o %t.o 2>&1 \
35*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-VFP3-D16 %s
36*0a6a1f1dSLionel Sambuc // RUN: %clang -target arm-linux-eabi -mfpu=vfpv3-d16 %s -### -o %t.o 2>&1 \
37*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-VFP3-D16 %s
38*0a6a1f1dSLionel Sambuc // CHECK-VFP3-D16: "-target-feature" "+vfp3"
39*0a6a1f1dSLionel Sambuc // CHECK-VFP3-D16: "-target-feature" "+d16"
40*0a6a1f1dSLionel Sambuc // CHECK-VFP3-D16: "-target-feature" "-neon"
41*0a6a1f1dSLionel Sambuc 
42*0a6a1f1dSLionel Sambuc // RUN: %clang -target arm-linux-eabi -mfpu=vfp4 %s -### -o %t.o 2>&1 \
43*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-VFP4 %s
44*0a6a1f1dSLionel Sambuc // RUN: %clang -target arm-linux-eabi -mfpu=vfpv4 %s -### -o %t.o 2>&1 \
45*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-VFP4 %s
46*0a6a1f1dSLionel Sambuc // CHECK-VFP4: "-target-feature" "+vfp4"
47*0a6a1f1dSLionel Sambuc // CHECK-VFP4: "-target-feature" "-neon"
48*0a6a1f1dSLionel Sambuc 
49*0a6a1f1dSLionel Sambuc // RUN: %clang -target arm-linux-eabi -mfpu=vfp4-d16 %s -### -o %t.o 2>&1 \
50*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-VFP4-D16 %s
51*0a6a1f1dSLionel Sambuc // RUN: %clang -target arm-linux-eabi -mfpu=vfpv4-d16 %s -### -o %t.o 2>&1 \
52*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-VFP4-D16 %s
53*0a6a1f1dSLionel Sambuc // CHECK-VFP4-D16: "-target-feature" "+vfp4"
54*0a6a1f1dSLionel Sambuc // CHECK-VFP4-D16: "-target-feature" "+d16"
55*0a6a1f1dSLionel Sambuc // CHECK-VFP4-D16: "-target-feature" "-neon"
56*0a6a1f1dSLionel Sambuc 
57*0a6a1f1dSLionel Sambuc // RUN: %clang -target arm-linux-eabi -mfpu=fp4-sp-d16 %s -### -o %t.o 2>&1 \
58*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-FP4-SP-D16 %s
59*0a6a1f1dSLionel Sambuc // RUN: %clang -target arm-linux-eabi -mfpu=fpv4-sp-d16 %s -### -o %t.o 2>&1 \
60*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-FP4-SP-D16 %s
61*0a6a1f1dSLionel Sambuc // CHECK-FP4-SP-D16: "-target-feature" "+vfp4"
62*0a6a1f1dSLionel Sambuc // CHECK-FP4-SP-D16: "-target-feature" "+d16"
63*0a6a1f1dSLionel Sambuc // CHECK-FP4-SP-D16: "-target-feature" "+fp-only-sp"
64*0a6a1f1dSLionel Sambuc // CHECK-FP4-SP-D16: "-target-feature" "-neon"
65*0a6a1f1dSLionel Sambuc 
66*0a6a1f1dSLionel Sambuc // RUN: %clang -target arm-linux-eabi -mfpu=fp5-sp-d16 %s -### -o %t.o 2>&1 \
67*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-FP5-SP-D16 %s
68*0a6a1f1dSLionel Sambuc // RUN: %clang -target arm-linux-eabi -mfpu=fpv5-sp-d16 %s -### -o %t.o 2>&1 \
69*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-FP5-SP-D16 %s
70*0a6a1f1dSLionel Sambuc // CHECK-FP5-SP-D16: "-target-feature" "+fp-armv8"
71*0a6a1f1dSLionel Sambuc // CHECK-FP5-SP-D16: "-target-feature" "+fp-only-sp"
72*0a6a1f1dSLionel Sambuc // CHECK-FP5-SP-D16: "-target-feature" "+d16"
73*0a6a1f1dSLionel Sambuc // CHECK-FP5-SP-D16: "-target-feature" "-neon"
74*0a6a1f1dSLionel Sambuc // CHECK-FP5-SP-D16: "-target-feature" "-crypto"
75*0a6a1f1dSLionel Sambuc 
76*0a6a1f1dSLionel Sambuc // RUN: %clang -target arm-linux-eabi -mfpu=fp5-dp-d16 %s -### -o %t.o 2>&1 \
77*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-FP5-DP-D16 %s
78*0a6a1f1dSLionel Sambuc // RUN: %clang -target arm-linux-eabi -mfpu=fpv5-dp-d16 %s -### -o %t.o 2>&1 \
79*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-FP5-DP-D16 %s
80*0a6a1f1dSLionel Sambuc // CHECK-FP5-DP-D16: "-target-feature" "+fp-armv8"
81*0a6a1f1dSLionel Sambuc // CHECK-FP5-DP-D16: "-target-feature" "+d16"
82*0a6a1f1dSLionel Sambuc // CHECK-FP5-DP-D16: "-target-feature" "-neon"
83*0a6a1f1dSLionel Sambuc // CHECK-FP5-DP-D16: "-target-feature" "-crypto"
84*0a6a1f1dSLionel Sambuc 
85f4a2713aSLionel Sambuc // RUN: %clang -target arm-linux-eabi -mfpu=neon %s -### -o %t.o 2>&1 \
86f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-NEON %s
87f4a2713aSLionel Sambuc // CHECK-NEON: "-target-feature" "+neon"
88f4a2713aSLionel Sambuc 
89*0a6a1f1dSLionel Sambuc // RUN: %clang -target arm-linux-eabi -mfpu=neon-vfpv3 %s -### -o %t.o 2>&1 \
90*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-NEON-VFPV3 %s
91*0a6a1f1dSLionel Sambuc // CHECK-NEON-VFPV3: "-target-feature" "+vfp3"
92*0a6a1f1dSLionel Sambuc // CHECK-NEON-VFPV3: "-target-feature" "+neon"
93*0a6a1f1dSLionel Sambuc 
94*0a6a1f1dSLionel Sambuc // RUN: %clang -target arm-linux-eabi -mfpu=neon-vfpv4 %s -### -o %t.o 2>&1 \
95*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-NEON-VFPV4 %s
96*0a6a1f1dSLionel Sambuc // CHECK-NEON-VFPV4: "-target-feature" "+neon"
97*0a6a1f1dSLionel Sambuc // CHECK-NEON-VFPV4: "-target-feature" "+vfp4"
98*0a6a1f1dSLionel Sambuc 
99f4a2713aSLionel Sambuc // RUN: %clang -target arm-linux-eabi -msoft-float %s -### -o %t.o 2>&1 \
100f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-SOFT-FLOAT %s
101f4a2713aSLionel Sambuc // CHECK-SOFT-FLOAT: "-target-feature" "-neon"
102f4a2713aSLionel Sambuc 
103*0a6a1f1dSLionel Sambuc // RUN: %clang -target armv8 %s -### 2>&1 \
104*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ARMV8-DEFAULT-SOFT-FP %s
105*0a6a1f1dSLionel Sambuc // CHECK-ARMV8-DEFAULT-SOFT-FP: "-target-feature" "-neon"
106*0a6a1f1dSLionel Sambuc // CHECK-ARMV8-DEFAULT-SOFT-FP: "-target-feature" "-crypto"
107*0a6a1f1dSLionel Sambuc 
108f4a2713aSLionel Sambuc // RUN: %clang -target armv8 -mfpu=fp-armv8 %s -### 2>&1 \
109f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ARMV8-SOFT-FLOAT %s
110f4a2713aSLionel Sambuc // CHECK-ARMV8-SOFT-FLOAT: "-target-feature" "+fp-armv8"
111f4a2713aSLionel Sambuc // CHECK-ARMV8-SOFT-FLOAT: "-target-feature" "-neon"
112*0a6a1f1dSLionel Sambuc // CHECK-ARMV8-SOFT-FLOAT: "-target-feature" "-crypto"
113f4a2713aSLionel Sambuc 
114f4a2713aSLionel Sambuc // RUN: %clang -target armv8-linux-gnueabihf -mfpu=fp-armv8 %s -### 2>&1 \
115f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-FP-ARMV8 %s
116f4a2713aSLionel Sambuc // CHECK-FP-ARMV8-NOT: "-target-feature" "+neon"
117f4a2713aSLionel Sambuc // CHECK-FP-ARMV8: "-target-feature" "+fp-armv8"
118f4a2713aSLionel Sambuc // CHECK-FP-ARMV8: "-target-feature" "-neon"
119f4a2713aSLionel Sambuc // CHECK-FP-ARMV8: "-target-feature" "-crypto"
120f4a2713aSLionel Sambuc 
121f4a2713aSLionel Sambuc // RUN: %clang -target armv8-linux-gnueabihf -mfpu=neon-fp-armv8 %s -### 2>&1 \
122f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-NEON-FP-ARMV8 %s
123f4a2713aSLionel Sambuc // CHECK-NEON-FP-ARMV8: "-target-feature" "+fp-armv8"
124f4a2713aSLionel Sambuc // CHECK-NEON-FP-ARMV8: "-target-feature" "+neon"
125f4a2713aSLionel Sambuc // CHECK-NEON-FP-ARMV8: "-target-feature" "-crypto"
126f4a2713aSLionel Sambuc 
127f4a2713aSLionel Sambuc // RUN: %clang -target armv8-linux-gnueabihf -mfpu=crypto-neon-fp-armv8 %s -### 2>&1 \
128f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-CRYPTO-NEON-FP-ARMV8 %s
129f4a2713aSLionel Sambuc // CHECK-CRYPTO-NEON-FP-ARMV8: "-target-feature" "+fp-armv8"
130f4a2713aSLionel Sambuc // CHECK-CRYPTO-NEON-FP-ARMV8: "-target-feature" "+neon"
131f4a2713aSLionel Sambuc // CHECK-CRYPTO-NEON-FP-ARMV8: "-target-feature" "+crypto"
132f4a2713aSLionel Sambuc 
133f4a2713aSLionel Sambuc // RUN: %clang -target armv8-linux-gnueabi -mfpu=none %s -### 2>&1 \
134f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-NO-FP %s
135f4a2713aSLionel Sambuc // CHECK-NO-FP: "-target-feature" "-vfp2"
136f4a2713aSLionel Sambuc // CHECK-NO-FP: "-target-feature" "-vfp3"
137f4a2713aSLionel Sambuc // CHECK-NO-FP: "-target-feature" "-vfp4"
138f4a2713aSLionel Sambuc // CHECK-NO-FP: "-target-feature" "-fp-armv8"
139f4a2713aSLionel Sambuc // CHECK-NO-FP: "-target-feature" "-crypto"
140f4a2713aSLionel Sambuc // CHECK-NO-FP: "-target-feature" "-neon"
141f4a2713aSLionel Sambuc 
142f4a2713aSLionel Sambuc // RUN: %clang -target arm-linux-gnueabihf %s -### 2>&1 \
143f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-HF %s
144f4a2713aSLionel Sambuc // CHECK-HF: "-target-cpu" "arm1136jf-s"
145*0a6a1f1dSLionel Sambuc 
146*0a6a1f1dSLionel Sambuc // RUN: %clang -target armv7-apple-darwin -x assembler %s -### -c 2>&1 \
147*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=ASM %s
148*0a6a1f1dSLionel Sambuc // ASM-NOT: -target-feature
149