• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // REQUIRES: mips-registered-target
2 // Check handling -mhard-float / -msoft-float / -mfloat-abi options
3 // when build for MIPS platforms.
4 //
5 // Default
6 // RUN: %clang -c %s -### -o %t.o 2>&1 \
7 // RUN:     -target mips-linux-gnu \
8 // RUN:   | FileCheck --check-prefix=CHECK-DEF %s
9 // CHECK-DEF: "-mfloat-abi" "hard"
10 //
11 // -mhard-float
12 // RUN: %clang -c %s -### -o %t.o 2>&1 \
13 // RUN:     -target mips-linux-gnu -mhard-float \
14 // RUN:   | FileCheck --check-prefix=CHECK-HARD %s
15 // CHECK-HARD: "-mfloat-abi" "hard"
16 //
17 // -msoft-float
18 // RUN: %clang -c %s -### -o %t.o 2>&1 \
19 // RUN:     -target mips-linux-gnu -msoft-float \
20 // RUN:   | FileCheck --check-prefix=CHECK-SOFT %s
21 // CHECK-SOFT: "-msoft-float"
22 // CHECK-SOFT: "-mfloat-abi" "soft"
23 // CHECK-SOFT: "-target-feature" "+soft-float"
24 //
25 // -mfloat-abi=hard
26 // RUN: %clang -c %s -### -o %t.o 2>&1 \
27 // RUN:     -target mips-linux-gnu -mfloat-abi=hard \
28 // RUN:   | FileCheck --check-prefix=CHECK-ABI-HARD %s
29 // CHECK-ABI-HARD: "-mfloat-abi" "hard"
30 //
31 // -mfloat-abi=soft
32 // RUN: %clang -c %s -### -o %t.o 2>&1 \
33 // RUN:     -target mips-linux-gnu -mfloat-abi=soft \
34 // RUN:   | FileCheck --check-prefix=CHECK-ABI-SOFT %s
35 // CHECK-ABI-SOFT: "-msoft-float"
36 // CHECK-ABI-SOFT: "-mfloat-abi" "soft"
37 // CHECK-ABI-SOFT: "-target-feature" "+soft-float"
38 //
39 // -mfloat-abi=single
40 // RUN: %clang -c %s -### -o %t.o 2>&1 \
41 // RUN:     -target mips-linux-gnu -mfloat-abi=single \
42 // RUN:   | FileCheck --check-prefix=CHECK-ABI-SINGLE %s
43 // CHECK-ABI-SINGLE: "-target-feature" "+single-float"
44 //
45 // Default -mips16
46 // RUN: %clang -c %s -### -o %t.o 2>&1 \
47 // RUN:     -target mips-linux-gnu -mips16 \
48 // RUN:   | FileCheck --check-prefix=CHECK-DEF-MIPS16 %s
49 // CHECK-DEF-MIPS16: "-mfloat-abi" "soft"
50 // CHECK-DEF-MIPS16: "-mllvm" "-mips16-hard-float"
51 //
52 // -mhard-float -mips16
53 // RUN: %clang -c %s -### -o %t.o 2>&1 \
54 // RUN:     -target mips-linux-gnu -mhard-float -mips16 \
55 // RUN:   | FileCheck --check-prefix=CHECK-HARD-MIPS16 %s
56 // CHECK-HARD-MIPS16: "-msoft-float"
57 // CHECK-HARD-MIPS16: "-mfloat-abi" "soft"
58 // CHECK-HARD-MIPS16: "-target-feature" "+soft-float"
59 // CHECK-HARD-MIPS16: "-mllvm" "-mips16-hard-float"
60 //
61 // -msoft-float -mips16
62 // RUN: %clang -c %s -### -o %t.o 2>&1 \
63 // RUN:     -target mips-linux-gnu -msoft-float -mips16 \
64 // RUN:   | FileCheck --check-prefix=CHECK-SOFT-MIPS16 %s
65 // CHECK-SOFT-MIPS16: "-msoft-float"
66 // CHECK-SOFT-MIPS16: "-mfloat-abi" "soft"
67 // CHECK-SOFT-MIPS16: "-target-feature" "+soft-float"
68 //
69 // -mfloat-abi=hard -mips16
70 // RUN: %clang -c %s -### -o %t.o 2>&1 \
71 // RUN:     -target mips-linux-gnu -mfloat-abi=hard -mips16 \
72 // RUN:   | FileCheck --check-prefix=CHECK-ABI-HARD-MIPS16 %s
73 // CHECK-ABI-HARD-MIPS16: "-msoft-float"
74 // CHECK-ABI-HARD-MIPS16: "-mfloat-abi" "soft"
75 // CHECK-ABI-HARD-MIPS16: "-target-feature" "+soft-float"
76 // CHECK-ABI-HARD-MIPS16: "-mllvm" "-mips16-hard-float"
77 //
78 // -mfloat-abi=soft -mips16
79 // RUN: %clang -c %s -### -o %t.o 2>&1 \
80 // RUN:     -target mips-linux-gnu -mfloat-abi=soft -mips16 \
81 // RUN:   | FileCheck --check-prefix=CHECK-ABI-SOFT-MIPS16 %s
82 // CHECK-ABI-SOFT-MIPS16: "-msoft-float"
83 // CHECK-ABI-SOFT-MIPS16: "-mfloat-abi" "soft"
84 // CHECK-ABI-SOFT-MIPS16: "-target-feature" "+soft-float"
85