blob: 1621075672980a325661d7fd19858b357edd6b2d [file] [log] [blame]
Akira Hatanaka54edd472012-03-26 17:37:20 +00001// Check handling -mhard-float / -msoft-float / -mfloat-abi options
2// when build for MIPS platforms.
3//
4// Default
Rafael Espindola238b6a92012-10-09 20:46:28 +00005// RUN: %clang -c %s -### -o %t.o 2>&1 \
Akira Hatanaka54edd472012-03-26 17:37:20 +00006// RUN: -target mips-linux-gnu \
7// RUN: | FileCheck --check-prefix=CHECK-DEF %s
8// CHECK-DEF: "-mfloat-abi" "hard"
9//
10// -mhard-float
Rafael Espindola238b6a92012-10-09 20:46:28 +000011// RUN: %clang -c %s -### -o %t.o 2>&1 \
Akira Hatanaka54edd472012-03-26 17:37:20 +000012// 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 Espindola238b6a92012-10-09 20:46:28 +000017// RUN: %clang -c %s -### -o %t.o 2>&1 \
Akira Hatanaka54edd472012-03-26 17:37:20 +000018// RUN: -target mips-linux-gnu -msoft-float \
19// RUN: | FileCheck --check-prefix=CHECK-SOFT %s
Rafael Espindola146dbbf2013-08-21 16:39:20 +000020// CHECK-SOFT: "-target-feature" "+soft-float"
Akira Hatanaka54edd472012-03-26 17:37:20 +000021// CHECK-SOFT: "-msoft-float"
22// CHECK-SOFT: "-mfloat-abi" "soft"
Akira Hatanaka54edd472012-03-26 17:37:20 +000023//
24// -mfloat-abi=hard
Rafael Espindola238b6a92012-10-09 20:46:28 +000025// RUN: %clang -c %s -### -o %t.o 2>&1 \
Akira Hatanaka54edd472012-03-26 17:37:20 +000026// 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 Espindola238b6a92012-10-09 20:46:28 +000031// RUN: %clang -c %s -### -o %t.o 2>&1 \
Akira Hatanaka54edd472012-03-26 17:37:20 +000032// RUN: -target mips-linux-gnu -mfloat-abi=soft \
33// RUN: | FileCheck --check-prefix=CHECK-ABI-SOFT %s
Rafael Espindola146dbbf2013-08-21 16:39:20 +000034// CHECK-ABI-SOFT: "-target-feature" "+soft-float"
Akira Hatanaka54edd472012-03-26 17:37:20 +000035// CHECK-ABI-SOFT: "-msoft-float"
36// CHECK-ABI-SOFT: "-mfloat-abi" "soft"
Akira Hatanaka54edd472012-03-26 17:37:20 +000037//
Simon Atanasyan2ed42b82013-04-14 08:37:15 +000038// -mdouble-float
Rafael Espindola238b6a92012-10-09 20:46:28 +000039// RUN: %clang -c %s -### -o %t.o 2>&1 \
Simon Atanasyan2ed42b82013-04-14 08:37:15 +000040// 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 Hatanaka54edd472012-03-26 17:37:20 +000048// RUN: | FileCheck --check-prefix=CHECK-ABI-SINGLE %s
49// CHECK-ABI-SINGLE: "-target-feature" "+single-float"
Rafael Espindola146dbbf2013-08-21 16:39:20 +000050// CHECK-ABI-SINGLE: "-mfloat-abi" "hard"
Simon Atanasyane1d792f2013-01-10 12:36:19 +000051//
Simon Atanasyan2ed42b82013-04-14 08:37:15 +000052// -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 Atanasyan2ed42b82013-04-14 08:37:15 +000056// CHECK-ABI-SOFT-SINGLE: "-target-feature" "+single-float"
Rafael Espindola146dbbf2013-08-21 16:39:20 +000057// CHECK-ABI-SOFT-SINGLE: "-mfloat-abi" "soft"
Simon Atanasyan2ed42b82013-04-14 08:37:15 +000058//
Simon Atanasyane1d792f2013-01-10 12:36:19 +000059// 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 Hines651f13c2014-04-23 16:59:28 -070063// CHECK-DEF-MIPS16: "-target-feature" "+mips16"
64// CHECK-DEF-MIPS16: "-mfloat-abi" "hard"
Simon Atanasyane1d792f2013-01-10 12:36:19 +000065//
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 Hines651f13c2014-04-23 16:59:28 -070070// CHECK-HARD-MIPS16: "-target-feature" "+mips16"
71// CHECK-HARD-MIPS16: "-mfloat-abi" "hard"
Simon Atanasyane1d792f2013-01-10 12:36:19 +000072//
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 Espindola146dbbf2013-08-21 16:39:20 +000077// CHECK-SOFT-MIPS16: "-target-feature" "+soft-float"
Stephen Hines651f13c2014-04-23 16:59:28 -070078// CHECK-SOFT-MIPS16: "-target-feature" "+mips16"
Simon Atanasyane1d792f2013-01-10 12:36:19 +000079// CHECK-SOFT-MIPS16: "-msoft-float"
80// CHECK-SOFT-MIPS16: "-mfloat-abi" "soft"
Simon Atanasyane1d792f2013-01-10 12:36:19 +000081//
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 Hines651f13c2014-04-23 16:59:28 -070086// CHECK-ABI-HARD-MIPS16: "-target-feature" "+mips16"
87// CHECK-ABI-HARD-MIPS16: "-mfloat-abi" "hard"
Simon Atanasyane1d792f2013-01-10 12:36:19 +000088//
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 Espindola146dbbf2013-08-21 16:39:20 +000093// CHECK-ABI-SOFT-MIPS16: "-target-feature" "+soft-float"
Stephen Hines651f13c2014-04-23 16:59:28 -070094// CHECK-ABI-SOFT-MIPS16: "-target-feature" "+mips16"
Simon Atanasyane1d792f2013-01-10 12:36:19 +000095// CHECK-ABI-SOFT-MIPS16: "-msoft-float"
96// CHECK-ABI-SOFT-MIPS16: "-mfloat-abi" "soft"