blob: 9e62c0a95e0496d8bc1de40271e09f9e0f99a755 [file] [log] [blame]
Akira Hatanakaefe96a62012-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 Espindolafc3fc0c2012-10-09 20:46:28 +00005// RUN: %clang -c %s -### -o %t.o 2>&1 \
Akira Hatanakaefe96a62012-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 Espindolafc3fc0c2012-10-09 20:46:28 +000011// RUN: %clang -c %s -### -o %t.o 2>&1 \
Akira Hatanakaefe96a62012-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 Espindolafc3fc0c2012-10-09 20:46:28 +000017// RUN: %clang -c %s -### -o %t.o 2>&1 \
Akira Hatanakaefe96a62012-03-26 17:37:20 +000018// RUN: -target mips-linux-gnu -msoft-float \
19// RUN: | FileCheck --check-prefix=CHECK-SOFT %s
20// CHECK-SOFT: "-msoft-float"
21// CHECK-SOFT: "-mfloat-abi" "soft"
22// CHECK-SOFT: "-target-feature" "+soft-float"
23//
24// -mfloat-abi=hard
Rafael Espindolafc3fc0c2012-10-09 20:46:28 +000025// RUN: %clang -c %s -### -o %t.o 2>&1 \
Akira Hatanakaefe96a62012-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 Espindolafc3fc0c2012-10-09 20:46:28 +000031// RUN: %clang -c %s -### -o %t.o 2>&1 \
Akira Hatanakaefe96a62012-03-26 17:37:20 +000032// RUN: -target mips-linux-gnu -mfloat-abi=soft \
33// RUN: | FileCheck --check-prefix=CHECK-ABI-SOFT %s
34// CHECK-ABI-SOFT: "-msoft-float"
35// CHECK-ABI-SOFT: "-mfloat-abi" "soft"
36// CHECK-ABI-SOFT: "-target-feature" "+soft-float"
37//
Simon Atanasyan512dc382013-04-14 08:37:15 +000038// -mdouble-float
Rafael Espindolafc3fc0c2012-10-09 20:46:28 +000039// RUN: %clang -c %s -### -o %t.o 2>&1 \
Simon Atanasyan512dc382013-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 Hatanakaefe96a62012-03-26 17:37:20 +000048// RUN: | FileCheck --check-prefix=CHECK-ABI-SINGLE %s
Simon Atanasyan512dc382013-04-14 08:37:15 +000049// CHECK-ABI-SINGLE: "-mfloat-abi" "hard"
Akira Hatanakaefe96a62012-03-26 17:37:20 +000050// CHECK-ABI-SINGLE: "-target-feature" "+single-float"
Simon Atanasyan81c423c2013-01-10 12:36:19 +000051//
Simon Atanasyan512dc382013-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
56// CHECK-ABI-SOFT-SINGLE: "-mfloat-abi" "soft"
57// CHECK-ABI-SOFT-SINGLE: "-target-feature" "+single-float"
58//
Simon Atanasyan81c423c2013-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
63// CHECK-DEF-MIPS16: "-mfloat-abi" "soft"
64// CHECK-DEF-MIPS16: "-mllvm" "-mips16-hard-float"
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
70// CHECK-HARD-MIPS16: "-msoft-float"
71// CHECK-HARD-MIPS16: "-mfloat-abi" "soft"
72// CHECK-HARD-MIPS16: "-target-feature" "+soft-float"
73// CHECK-HARD-MIPS16: "-mllvm" "-mips16-hard-float"
74//
75// -msoft-float -mips16
76// RUN: %clang -c %s -### -o %t.o 2>&1 \
77// RUN: -target mips-linux-gnu -msoft-float -mips16 \
78// RUN: | FileCheck --check-prefix=CHECK-SOFT-MIPS16 %s
79// CHECK-SOFT-MIPS16: "-msoft-float"
80// CHECK-SOFT-MIPS16: "-mfloat-abi" "soft"
81// CHECK-SOFT-MIPS16: "-target-feature" "+soft-float"
82//
83// -mfloat-abi=hard -mips16
84// RUN: %clang -c %s -### -o %t.o 2>&1 \
85// RUN: -target mips-linux-gnu -mfloat-abi=hard -mips16 \
86// RUN: | FileCheck --check-prefix=CHECK-ABI-HARD-MIPS16 %s
87// CHECK-ABI-HARD-MIPS16: "-msoft-float"
88// CHECK-ABI-HARD-MIPS16: "-mfloat-abi" "soft"
89// CHECK-ABI-HARD-MIPS16: "-target-feature" "+soft-float"
90// CHECK-ABI-HARD-MIPS16: "-mllvm" "-mips16-hard-float"
91//
92// -mfloat-abi=soft -mips16
93// RUN: %clang -c %s -### -o %t.o 2>&1 \
94// RUN: -target mips-linux-gnu -mfloat-abi=soft -mips16 \
95// RUN: | FileCheck --check-prefix=CHECK-ABI-SOFT-MIPS16 %s
96// CHECK-ABI-SOFT-MIPS16: "-msoft-float"
97// CHECK-ABI-SOFT-MIPS16: "-mfloat-abi" "soft"
98// CHECK-ABI-SOFT-MIPS16: "-target-feature" "+soft-float"