1 // Test that different values of -mfpu pick correct ARM FPU target-feature(s).
2 
3 // RUN: %clang -target arm-linux-eabi %s -### -o %t.o 2>&1 \
4 // 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 
10 // RUN: %clang -target arm-linux-eabi -mfpu=fpa %s -### -o %t.o 2>&1 \
11 // RUN:   | FileCheck --check-prefix=CHECK-FPA %s
12 // RUN: %clang -target arm-linux-eabi -mfpu=fpe2 %s -### -o %t.o 2>&1 \
13 // RUN:   | FileCheck --check-prefix=CHECK-FPA %s
14 // RUN: %clang -target arm-linux-eabi -mfpu=fpe3 %s -### -o %t.o 2>&1 \
15 // RUN:   | FileCheck --check-prefix=CHECK-FPA %s
16 // RUN: %clang -target arm-linux-eabi -mfpu=maverick %s -### -o %t.o 2>&1 \
17 // 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 
22 // RUN: %clang -target arm-linux-eabi -mfpu=vfp3-d16 %s -### -o %t.o 2>&1 \
23 // RUN:   | FileCheck --check-prefix=CHECK-VFP3-D16 %s
24 // RUN: %clang -target arm-linux-eabi -mfpu=vfpv3-d16 %s -### -o %t.o 2>&1 \
25 // 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 
30 // RUN: %clang -target arm-linux-eabi -mfpu=vfp %s -### -o %t.o 2>&1 \
31 // RUN:   | FileCheck --check-prefix=CHECK-VFP %s
32 // CHECK-VFP: "-target-feature" "+vfp2"
33 // CHECK-VFP: "-target-feature" "-neon"
34 
35 // RUN: %clang -target arm-linux-eabi -mfpu=vfp3 %s -### -o %t.o 2>&1 \
36 // RUN:   | FileCheck --check-prefix=CHECK-VFP3 %s
37 // RUN: %clang -target arm-linux-eabi -mfpu=vfpv3 %s -### -o %t.o 2>&1 \
38 // RUN:   | FileCheck --check-prefix=CHECK-VFP3 %s
39 // CHECK-VFP3: "-target-feature" "+vfp3"
40 // CHECK-VFP3: "-target-feature" "-neon"
41 
42 // RUN: %clang -target arm-linux-eabi -mfpu=neon %s -### -o %t.o 2>&1 \
43 // RUN:   | FileCheck --check-prefix=CHECK-NEON %s
44 // CHECK-NEON: "-target-feature" "+neon"
45 
46 // RUN: %clang -target arm-linux-eabi -msoft-float %s -### -o %t.o 2>&1 \
47 // RUN:   | FileCheck --check-prefix=CHECK-SOFT-FLOAT %s
48 // CHECK-SOFT-FLOAT: "-target-feature" "-neon"
49 
50 // 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 
56 // RUN: %clang -target armv8-linux-gnueabihf -mfpu=fp-armv8 %s -### 2>&1 \
57 // RUN:   | FileCheck --check-prefix=CHECK-FP-ARMV8 %s
58 // CHECK-FP-ARMV8-NOT: "-target-feature" "+neon"
59 // CHECK-FP-ARMV8: "-target-feature" "+fp-armv8"
60 // CHECK-FP-ARMV8: "-target-feature" "-neon"
61 // CHECK-FP-ARMV8: "-target-feature" "-crypto"
62 
63 // RUN: %clang -target armv8-linux-gnueabihf -mfpu=neon-fp-armv8 %s -### 2>&1 \
64 // RUN:   | FileCheck --check-prefix=CHECK-NEON-FP-ARMV8 %s
65 // CHECK-NEON-FP-ARMV8: "-target-feature" "+fp-armv8"
66 // CHECK-NEON-FP-ARMV8: "-target-feature" "+neon"
67 // CHECK-NEON-FP-ARMV8: "-target-feature" "-crypto"
68 
69 // 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
71 // CHECK-CRYPTO-NEON-FP-ARMV8: "-target-feature" "+fp-armv8"
72 // CHECK-CRYPTO-NEON-FP-ARMV8: "-target-feature" "+neon"
73 // CHECK-CRYPTO-NEON-FP-ARMV8: "-target-feature" "+crypto"
74 
75 // 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 
84 // RUN: %clang -target arm-linux-gnueabihf %s -### 2>&1 \
85 // RUN:   | FileCheck --check-prefix=CHECK-HF %s
86 // CHECK-HF: "-target-cpu" "arm1136jf-s"
87