| 1 |
// Check handling -mhard-float / -msoft-float / -mfloat-abi options |
| 2 |
// when build for MIPS platforms. |
| 3 |
// |
| 4 |
// Default |
| 5 |
// RUN: %clang -c %s -### -o %t.o 2>&1 \ |
| 6 |
// RUN: --target=mips-linux-gnu \ |
| 7 |
// RUN: | FileCheck --check-prefix=CHECK-DEF %s |
| 8 |
// CHECK-DEF: "-mfloat-abi" "hard" |
| 9 |
// |
| 10 |
// Default on FreeBSD |
| 11 |
// RUN: %clang -c %s -### -o %t.o 2>&1 \ |
| 12 |
// RUN: --target=mips-freebsd12 \ |
| 13 |
// RUN: | FileCheck --check-prefix=DEF-FREEBSD %s |
| 14 |
// DEF-FREEBSD: "-target-feature" "+soft-float" |
| 15 |
// DEF-FREEBSD: "-msoft-float" |
| 16 |
// DEF-FREEBSD: "-mfloat-abi" "soft" |
| 17 |
// |
| 18 |
// -mhard-float |
| 19 |
// RUN: %clang -c %s -### -o %t.o 2>&1 \ |
| 20 |
// RUN: --target=mips-linux-gnu -mhard-float \ |
| 21 |
// RUN: | FileCheck --check-prefix=CHECK-HARD %s |
| 22 |
// CHECK-HARD: "-mfloat-abi" "hard" |
| 23 |
// |
| 24 |
// -msoft-float |
| 25 |
// RUN: %clang -c %s -### -o %t.o 2>&1 \ |
| 26 |
// RUN: --target=mips-linux-gnu -msoft-float \ |
| 27 |
// RUN: | FileCheck --check-prefix=CHECK-SOFT %s |
| 28 |
// CHECK-SOFT: "-target-feature" "+soft-float" |
| 29 |
// CHECK-SOFT: "-msoft-float" |
| 30 |
// CHECK-SOFT: "-mfloat-abi" "soft" |
| 31 |
// |
| 32 |
// -mfloat-abi=hard |
| 33 |
// RUN: %clang -c %s -### -o %t.o 2>&1 \ |
| 34 |
// RUN: --target=mips-linux-gnu -mfloat-abi=hard \ |
| 35 |
// RUN: | FileCheck --check-prefix=CHECK-ABI-HARD %s |
| 36 |
// CHECK-ABI-HARD: "-mfloat-abi" "hard" |
| 37 |
// |
| 38 |
// -mfloat-abi=soft |
| 39 |
// RUN: %clang -c %s -### -o %t.o 2>&1 \ |
| 40 |
// RUN: --target=mips-linux-gnu -mfloat-abi=soft \ |
| 41 |
// RUN: | FileCheck --check-prefix=CHECK-ABI-SOFT %s |
| 42 |
// CHECK-ABI-SOFT: "-target-feature" "+soft-float" |
| 43 |
// CHECK-ABI-SOFT: "-msoft-float" |
| 44 |
// CHECK-ABI-SOFT: "-mfloat-abi" "soft" |
| 45 |
// |
| 46 |
// -mdouble-float |
| 47 |
// RUN: %clang -c %s -### -o %t.o 2>&1 \ |
| 48 |
// RUN: --target=mips-linux-gnu -msingle-float -mdouble-float \ |
| 49 |
// RUN: | FileCheck --check-prefix=CHECK-ABI-DOUBLE %s |
| 50 |
// CHECK-ABI-DOUBLE: "-mfloat-abi" "hard" |
| 51 |
// CHECK-ABI-DOUBLE-NOT: "+single-float" |
| 52 |
// |
| 53 |
// -msingle-float |
| 54 |
// RUN: %clang -c %s -### -o %t.o 2>&1 \ |
| 55 |
// RUN: --target=mips-linux-gnu -mdouble-float -msingle-float \ |
| 56 |
// RUN: | FileCheck --check-prefix=CHECK-ABI-SINGLE %s |
| 57 |
// CHECK-ABI-SINGLE: "-target-feature" "+single-float" |
| 58 |
// CHECK-ABI-SINGLE: "-mfloat-abi" "hard" |
| 59 |
// |
| 60 |
// -msoft-float -msingle-float |
| 61 |
// RUN: %clang -c %s -### -o %t.o 2>&1 \ |
| 62 |
// RUN: --target=mips-linux-gnu -msoft-float -msingle-float \ |
| 63 |
// RUN: | FileCheck --check-prefix=CHECK-ABI-SOFT-SINGLE %s |
| 64 |
// CHECK-ABI-SOFT-SINGLE: "-target-feature" "+single-float" |
| 65 |
// CHECK-ABI-SOFT-SINGLE: "-mfloat-abi" "soft" |
| 66 |
// |
| 67 |
// Default -mips16 |
| 68 |
// RUN: %clang -c %s -### -o %t.o 2>&1 \ |
| 69 |
// RUN: --target=mips-linux-gnu -mips16 \ |
| 70 |
// RUN: | FileCheck --check-prefix=CHECK-DEF-MIPS16 %s |
| 71 |
// CHECK-DEF-MIPS16: "-target-feature" "+mips16" |
| 72 |
// CHECK-DEF-MIPS16: "-mfloat-abi" "hard" |
| 73 |
// |
| 74 |
// -mhard-float -mips16 |
| 75 |
// RUN: %clang -c %s -### -o %t.o 2>&1 \ |
| 76 |
// RUN: --target=mips-linux-gnu -mhard-float -mips16 \ |
| 77 |
// RUN: | FileCheck --check-prefix=CHECK-HARD-MIPS16 %s |
| 78 |
// CHECK-HARD-MIPS16: "-target-feature" "+mips16" |
| 79 |
// CHECK-HARD-MIPS16: "-mfloat-abi" "hard" |
| 80 |
// |
| 81 |
// -msoft-float -mips16 |
| 82 |
// RUN: %clang -c %s -### -o %t.o 2>&1 \ |
| 83 |
// RUN: --target=mips-linux-gnu -msoft-float -mips16 \ |
| 84 |
// RUN: | FileCheck --check-prefix=CHECK-SOFT-MIPS16 %s |
| 85 |
// CHECK-SOFT-MIPS16: "-target-feature" "+soft-float" |
| 86 |
// CHECK-SOFT-MIPS16: "-target-feature" "+mips16" |
| 87 |
// CHECK-SOFT-MIPS16: "-msoft-float" |
| 88 |
// CHECK-SOFT-MIPS16: "-mfloat-abi" "soft" |
| 89 |
// |
| 90 |
// -mfloat-abi=hard -mips16 |
| 91 |
// RUN: %clang -c %s -### -o %t.o 2>&1 \ |
| 92 |
// RUN: --target=mips-linux-gnu -mfloat-abi=hard -mips16 \ |
| 93 |
// RUN: | FileCheck --check-prefix=CHECK-ABI-HARD-MIPS16 %s |
| 94 |
// CHECK-ABI-HARD-MIPS16: "-target-feature" "+mips16" |
| 95 |
// CHECK-ABI-HARD-MIPS16: "-mfloat-abi" "hard" |
| 96 |
// |
| 97 |
// -mfloat-abi=soft -mips16 |
| 98 |
// RUN: %clang -c %s -### -o %t.o 2>&1 \ |
| 99 |
// RUN: --target=mips-linux-gnu -mfloat-abi=soft -mips16 \ |
| 100 |
// RUN: | FileCheck --check-prefix=CHECK-ABI-SOFT-MIPS16 %s |
| 101 |
// CHECK-ABI-SOFT-MIPS16: "-target-feature" "+soft-float" |
| 102 |
// CHECK-ABI-SOFT-MIPS16: "-target-feature" "+mips16" |
| 103 |
// CHECK-ABI-SOFT-MIPS16: "-msoft-float" |
| 104 |
// CHECK-ABI-SOFT-MIPS16: "-mfloat-abi" "soft" |