Akira Hatanaka | 54edd47 | 2012-03-26 17:37:20 +0000 | [diff] [blame] | 1 | // Check handling -mhard-float / -msoft-float / -mfloat-abi options |
| 2 | // when build for MIPS platforms. |
| 3 | // |
| 4 | // Default |
Rafael Espindola | 238b6a9 | 2012-10-09 20:46:28 +0000 | [diff] [blame] | 5 | // RUN: %clang -c %s -### -o %t.o 2>&1 \ |
Akira Hatanaka | 54edd47 | 2012-03-26 17:37:20 +0000 | [diff] [blame] | 6 | // RUN: -target mips-linux-gnu \ |
| 7 | // RUN: | FileCheck --check-prefix=CHECK-DEF %s |
| 8 | // CHECK-DEF: "-mfloat-abi" "hard" |
| 9 | // |
| 10 | // -mhard-float |
Rafael Espindola | 238b6a9 | 2012-10-09 20:46:28 +0000 | [diff] [blame] | 11 | // RUN: %clang -c %s -### -o %t.o 2>&1 \ |
Akira Hatanaka | 54edd47 | 2012-03-26 17:37:20 +0000 | [diff] [blame] | 12 | // RUN: -target mips-linux-gnu -mhard-float \ |
| 13 | // RUN: | FileCheck --check-prefix=CHECK-HARD %s |
| 14 | // CHECK-HARD: "-mfloat-abi" "hard" |
| 15 | // |
| 16 | // -msoft-float |
Rafael Espindola | 238b6a9 | 2012-10-09 20:46:28 +0000 | [diff] [blame] | 17 | // RUN: %clang -c %s -### -o %t.o 2>&1 \ |
Akira Hatanaka | 54edd47 | 2012-03-26 17:37:20 +0000 | [diff] [blame] | 18 | // RUN: -target mips-linux-gnu -msoft-float \ |
| 19 | // RUN: | FileCheck --check-prefix=CHECK-SOFT %s |
Rafael Espindola | 146dbbf | 2013-08-21 16:39:20 +0000 | [diff] [blame] | 20 | // CHECK-SOFT: "-target-feature" "+soft-float" |
Akira Hatanaka | 54edd47 | 2012-03-26 17:37:20 +0000 | [diff] [blame] | 21 | // CHECK-SOFT: "-msoft-float" |
| 22 | // CHECK-SOFT: "-mfloat-abi" "soft" |
Akira Hatanaka | 54edd47 | 2012-03-26 17:37:20 +0000 | [diff] [blame] | 23 | // |
| 24 | // -mfloat-abi=hard |
Rafael Espindola | 238b6a9 | 2012-10-09 20:46:28 +0000 | [diff] [blame] | 25 | // RUN: %clang -c %s -### -o %t.o 2>&1 \ |
Akira Hatanaka | 54edd47 | 2012-03-26 17:37:20 +0000 | [diff] [blame] | 26 | // RUN: -target mips-linux-gnu -mfloat-abi=hard \ |
| 27 | // RUN: | FileCheck --check-prefix=CHECK-ABI-HARD %s |
| 28 | // CHECK-ABI-HARD: "-mfloat-abi" "hard" |
| 29 | // |
| 30 | // -mfloat-abi=soft |
Rafael Espindola | 238b6a9 | 2012-10-09 20:46:28 +0000 | [diff] [blame] | 31 | // RUN: %clang -c %s -### -o %t.o 2>&1 \ |
Akira Hatanaka | 54edd47 | 2012-03-26 17:37:20 +0000 | [diff] [blame] | 32 | // RUN: -target mips-linux-gnu -mfloat-abi=soft \ |
| 33 | // RUN: | FileCheck --check-prefix=CHECK-ABI-SOFT %s |
Rafael Espindola | 146dbbf | 2013-08-21 16:39:20 +0000 | [diff] [blame] | 34 | // CHECK-ABI-SOFT: "-target-feature" "+soft-float" |
Akira Hatanaka | 54edd47 | 2012-03-26 17:37:20 +0000 | [diff] [blame] | 35 | // CHECK-ABI-SOFT: "-msoft-float" |
| 36 | // CHECK-ABI-SOFT: "-mfloat-abi" "soft" |
Akira Hatanaka | 54edd47 | 2012-03-26 17:37:20 +0000 | [diff] [blame] | 37 | // |
Simon Atanasyan | 2ed42b8 | 2013-04-14 08:37:15 +0000 | [diff] [blame] | 38 | // -mdouble-float |
Rafael Espindola | 238b6a9 | 2012-10-09 20:46:28 +0000 | [diff] [blame] | 39 | // RUN: %clang -c %s -### -o %t.o 2>&1 \ |
Simon Atanasyan | 2ed42b8 | 2013-04-14 08:37:15 +0000 | [diff] [blame] | 40 | // RUN: -target mips-linux-gnu -msingle-float -mdouble-float \ |
| 41 | // RUN: | FileCheck --check-prefix=CHECK-ABI-DOUBLE %s |
| 42 | // CHECK-ABI-DOUBLE: "-mfloat-abi" "hard" |
| 43 | // CHECK-ABI-DOUBLE-NOT: "+single-float" |
| 44 | // |
| 45 | // -msingle-float |
| 46 | // RUN: %clang -c %s -### -o %t.o 2>&1 \ |
| 47 | // RUN: -target mips-linux-gnu -mdouble-float -msingle-float \ |
Akira Hatanaka | 54edd47 | 2012-03-26 17:37:20 +0000 | [diff] [blame] | 48 | // RUN: | FileCheck --check-prefix=CHECK-ABI-SINGLE %s |
| 49 | // CHECK-ABI-SINGLE: "-target-feature" "+single-float" |
Rafael Espindola | 146dbbf | 2013-08-21 16:39:20 +0000 | [diff] [blame] | 50 | // CHECK-ABI-SINGLE: "-mfloat-abi" "hard" |
Simon Atanasyan | e1d792f | 2013-01-10 12:36:19 +0000 | [diff] [blame] | 51 | // |
Simon Atanasyan | 2ed42b8 | 2013-04-14 08:37:15 +0000 | [diff] [blame] | 52 | // -msoft-float -msingle-float |
| 53 | // RUN: %clang -c %s -### -o %t.o 2>&1 \ |
| 54 | // RUN: -target mips-linux-gnu -msoft-float -msingle-float \ |
| 55 | // RUN: | FileCheck --check-prefix=CHECK-ABI-SOFT-SINGLE %s |
Simon Atanasyan | 2ed42b8 | 2013-04-14 08:37:15 +0000 | [diff] [blame] | 56 | // CHECK-ABI-SOFT-SINGLE: "-target-feature" "+single-float" |
Rafael Espindola | 146dbbf | 2013-08-21 16:39:20 +0000 | [diff] [blame] | 57 | // CHECK-ABI-SOFT-SINGLE: "-mfloat-abi" "soft" |
Simon Atanasyan | 2ed42b8 | 2013-04-14 08:37:15 +0000 | [diff] [blame] | 58 | // |
Simon Atanasyan | e1d792f | 2013-01-10 12:36:19 +0000 | [diff] [blame] | 59 | // Default -mips16 |
| 60 | // RUN: %clang -c %s -### -o %t.o 2>&1 \ |
| 61 | // RUN: -target mips-linux-gnu -mips16 \ |
| 62 | // RUN: | FileCheck --check-prefix=CHECK-DEF-MIPS16 %s |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 63 | // CHECK-DEF-MIPS16: "-target-feature" "+mips16" |
| 64 | // CHECK-DEF-MIPS16: "-mfloat-abi" "hard" |
Simon Atanasyan | e1d792f | 2013-01-10 12:36:19 +0000 | [diff] [blame] | 65 | // |
| 66 | // -mhard-float -mips16 |
| 67 | // RUN: %clang -c %s -### -o %t.o 2>&1 \ |
| 68 | // RUN: -target mips-linux-gnu -mhard-float -mips16 \ |
| 69 | // RUN: | FileCheck --check-prefix=CHECK-HARD-MIPS16 %s |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 70 | // CHECK-HARD-MIPS16: "-target-feature" "+mips16" |
| 71 | // CHECK-HARD-MIPS16: "-mfloat-abi" "hard" |
Simon Atanasyan | e1d792f | 2013-01-10 12:36:19 +0000 | [diff] [blame] | 72 | // |
| 73 | // -msoft-float -mips16 |
| 74 | // RUN: %clang -c %s -### -o %t.o 2>&1 \ |
| 75 | // RUN: -target mips-linux-gnu -msoft-float -mips16 \ |
| 76 | // RUN: | FileCheck --check-prefix=CHECK-SOFT-MIPS16 %s |
Rafael Espindola | 146dbbf | 2013-08-21 16:39:20 +0000 | [diff] [blame] | 77 | // CHECK-SOFT-MIPS16: "-target-feature" "+soft-float" |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 78 | // CHECK-SOFT-MIPS16: "-target-feature" "+mips16" |
Simon Atanasyan | e1d792f | 2013-01-10 12:36:19 +0000 | [diff] [blame] | 79 | // CHECK-SOFT-MIPS16: "-msoft-float" |
| 80 | // CHECK-SOFT-MIPS16: "-mfloat-abi" "soft" |
Simon Atanasyan | e1d792f | 2013-01-10 12:36:19 +0000 | [diff] [blame] | 81 | // |
| 82 | // -mfloat-abi=hard -mips16 |
| 83 | // RUN: %clang -c %s -### -o %t.o 2>&1 \ |
| 84 | // RUN: -target mips-linux-gnu -mfloat-abi=hard -mips16 \ |
| 85 | // RUN: | FileCheck --check-prefix=CHECK-ABI-HARD-MIPS16 %s |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 86 | // CHECK-ABI-HARD-MIPS16: "-target-feature" "+mips16" |
| 87 | // CHECK-ABI-HARD-MIPS16: "-mfloat-abi" "hard" |
Simon Atanasyan | e1d792f | 2013-01-10 12:36:19 +0000 | [diff] [blame] | 88 | // |
| 89 | // -mfloat-abi=soft -mips16 |
| 90 | // RUN: %clang -c %s -### -o %t.o 2>&1 \ |
| 91 | // RUN: -target mips-linux-gnu -mfloat-abi=soft -mips16 \ |
| 92 | // RUN: | FileCheck --check-prefix=CHECK-ABI-SOFT-MIPS16 %s |
Rafael Espindola | 146dbbf | 2013-08-21 16:39:20 +0000 | [diff] [blame] | 93 | // CHECK-ABI-SOFT-MIPS16: "-target-feature" "+soft-float" |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 94 | // CHECK-ABI-SOFT-MIPS16: "-target-feature" "+mips16" |
Simon Atanasyan | e1d792f | 2013-01-10 12:36:19 +0000 | [diff] [blame] | 95 | // CHECK-ABI-SOFT-MIPS16: "-msoft-float" |
| 96 | // CHECK-ABI-SOFT-MIPS16: "-mfloat-abi" "soft" |