1 // Test that different values of -mfpu pick correct CSKY FPU target-feature(s).
3 // RUN: %clang -target csky-unknown-linux %s -### -o %t.o 2>&1 \
4 // RUN: | FileCheck --check-prefix=CHECK-DEFAULT %s
5 // CHECK-DEFAULT-NOT: "-target-feature" "+hard-float"
6 // CHECK-DEFAULT-NOT: "-target-feature" "+hard-float-abi"
7 // CHECK-DEFAULT-NOT: "-target-feature" "+fpuv2_sf"
8 // CHECK-DEFAULT-NOT: "-target-feature" "+fpuv2_df"
10 // RUN: %clang -target csky-unknown-linux %s -mfpu=fpv2 -### -o %t.o 2>&1 \
11 // RUN: | FileCheck --check-prefix=CHECK-FPV2 %s
12 // CHECK-FPV2-NOT: "-target-feature" "+hard-float"
13 // CHECK-FPV2-NOT: "-target-feature" "+hard-float-abi"
14 // CHECK-FPV2: "-target-feature" "+fpuv2_sf"
15 // CHECK-FPV2: "-target-feature" "+fpuv2_df"
17 // RUN: %clang -target csky-unknown-linux %s -mfpu=fpv2 -mhard-float -### -o %t.o 2>&1 \
18 // RUN: | FileCheck --check-prefix=CHECK-FPV2-HARD %s
19 // CHECK-FPV2-HARD: "-target-feature" "+hard-float-abi"
20 // CHECK-FPV2-HARD: "-target-feature" "+hard-float"
21 // CHECK-FPV2-HARD: "-target-feature" "+fpuv2_sf"
22 // CHECK-FPV2-HARD: "-target-feature" "+fpuv2_df"
24 // RUN: %clang -target csky-unknown-linux %s -mfpu=fpv2_divd -mhard-float -### -o %t.o 2>&1 \
25 // RUN: | FileCheck --check-prefix=CHECK-FPV2DIVD-HARD %s
26 // CHECK-FPV2DIVD-HARD: "-target-feature" "+hard-float-abi"
27 // CHECK-FPV2DIVD-HARD: "-target-feature" "+hard-float"
28 // CHECK-FPV2DIVD-HARD: "-target-feature" "+fpuv2_sf"
29 // CHECK-FPV2DIVD-HARD: "-target-feature" "+fpuv2_df"
30 // CHECK-FPV2DIVD-HARD: "-target-feature" "+fdivdu"
32 // RUN: %clang -target csky-unknown-linux %s -mfpu=auto -mhard-float -### -o %t.o 2>&1 \
33 // RUN: | FileCheck --check-prefix=CHECK-AUTO-HARD %s
34 // CHECK-AUTO-HARD: "-target-feature" "+hard-float-abi"
35 // CHECK-AUTO-HARD: "-target-feature" "+hard-float"
36 // CHECK-AUTO-HARD: "-target-feature" "+fpuv2_sf"
37 // CHECK-AUTO-HARD: "-target-feature" "+fpuv2_df"
38 // CHECK-AUTO-HARD: "-target-feature" "+fdivdu"
40 // RUN: %clang -target csky-unknown-linux %s -mfpu=fpv2_sf -mhard-float -### -o %t.o 2>&1 \
41 // RUN: | FileCheck --check-prefix=CHECK-FPV2SF-HARD %s
42 // CHECK-FPV2SF-HARD: "-target-feature" "+hard-float-abi"
43 // CHECK-FPV2SF-HARD: "-target-feature" "+hard-float"
44 // CHECK-FPV2SF-HARD: "-target-feature" "+fpuv2_sf"
46 // RUN: %clang -target csky-unknown-linux %s -mfpu=fpv3 -mhard-float -### -o %t.o 2>&1 \
47 // RUN: | FileCheck --check-prefix=CHECK-FPV3-HARD %s
48 // CHECK-FPV3-HARD: "-target-feature" "+hard-float-abi"
49 // CHECK-FPV3-HARD: "-target-feature" "+hard-float"
50 // CHECK-FPV3-HARD: "-target-feature" "+fpuv3_hf"
51 // CHECK-FPV3-HARD: "-target-feature" "+fpuv3_hi"
52 // CHECK-FPV3-HARD: "-target-feature" "+fpuv3_sf"
53 // CHECK-FPV3-HARD: "-target-feature" "+fpuv3_df"
55 // RUN: %clang -target csky-unknown-linux %s -mfpu=fpv3_hf -mhard-float -### -o %t.o 2>&1 \
56 // RUN: | FileCheck --check-prefix=CHECK-FPV3HF-HARD %s
57 // CHECK-FPV3HF-HARD: "-target-feature" "+hard-float-abi"
58 // CHECK-FPV3HF-HARD: "-target-feature" "+hard-float"
59 // CHECK-FPV3HF-HARD: "-target-feature" "+fpuv3_hf"
60 // CHECK-FPV3HF-HARD: "-target-feature" "+fpuv3_hi"
62 // RUN: %clang -target csky-unknown-linux %s -mfpu=fpv3_hsf -mhard-float -### -o %t.o 2>&1 \
63 // RUN: | FileCheck --check-prefix=CHECK-FPV3HSF-HARD %s
64 // CHECK-FPV3HSF-HARD: "-target-feature" "+hard-float-abi"
65 // CHECK-FPV3HSF-HARD: "-target-feature" "+hard-float"
66 // CHECK-FPV3HSF-HARD: "-target-feature" "+fpuv3_hf"
67 // CHECK-FPV3HSF-HARD: "-target-feature" "+fpuv3_hi"
68 // CHECK-FPV3HSF-HARD: "-target-feature" "+fpuv3_sf"
70 // RUN: %clang -target csky-unknown-linux %s -mfpu=fpv3_sdf -mhard-float -### -o %t.o 2>&1 \
71 // RUN: | FileCheck --check-prefix=CHECK-FPV3DF-HARD %s
72 // CHECK-FPV3DF-HARD: "-target-feature" "+hard-float-abi"
73 // CHECK-FPV3DF-HARD: "-target-feature" "+hard-float"
74 // CHECK-FPV3DF-HARD: "-target-feature" "+fpuv3_sf"
75 // CHECK-FPV3DF-HARD: "-target-feature" "+fpuv3_df"
77 // RUN: %clang -target csky-unknown-linux %s -mcpu=c810 -mfpu=fpv3 -mhard-float -### -o %t.o 2>&1 \
78 // RUN: | FileCheck --check-prefix=CHECK-FPV3-C810 %s
79 // CHECK-FPV3-C810: "-target-feature" "+hard-float-abi"
80 // CHECK-FPV3-C810: "-target-feature" "+hard-float"
81 // CHECK-FPV3-C810: "-target-feature" "+fpuv3_hf"
82 // CHECK-FPV3-C810: "-target-feature" "+fpuv3_hi"
83 // CHECK-FPV3-C810: "-target-feature" "+fpuv3_sf"
84 // CHECK-FPV3-C810: "-target-feature" "+fpuv3_df"
85 // CHECK-FPV3-C810-NOT: "-target-feature" "+fpuv2"
87 // RUN: %clang -target csky-unknown-linux %s -mcpu=c860 -mfpu=fpv2 -mhard-float -### -o %t.o 2>&1 \
88 // RUN: | FileCheck --check-prefix=CHECK-FPV2-C860 %s
89 // CHECK-FPV2-C860: "-target-feature" "+hard-float-abi"
90 // CHECK-FPV2-C860: "-target-feature" "+hard-float"
91 // CHECK-FPV2-C860: "-target-feature" "+fpuv2_sf"
92 // CHECK-FPV2-C860: "-target-feature" "+fpuv2_df"
93 // CHECK-FPV2-C860-NOT: "-target-feature" "+fpuv3"