blob: 5c16b9b06351b97975c3e18bff02e15922c89ed7 [file] [log] [blame]
Jim Grosbach2987c572012-07-09 18:34:21 +00001// REQUIRES: mips-registered-target
Akira Hatanakaefe96a62012-03-26 17:37:20 +00002// Check handling -mhard-float / -msoft-float / -mfloat-abi options
3// when build for MIPS platforms.
4//
5// Default
Rafael Espindolafc3fc0c2012-10-09 20:46:28 +00006// RUN: %clang -c %s -### -o %t.o 2>&1 \
Akira Hatanakaefe96a62012-03-26 17:37:20 +00007// RUN: -target mips-linux-gnu \
8// RUN: | FileCheck --check-prefix=CHECK-DEF %s
9// CHECK-DEF: "-mfloat-abi" "hard"
10//
11// -mhard-float
Rafael Espindolafc3fc0c2012-10-09 20:46:28 +000012// RUN: %clang -c %s -### -o %t.o 2>&1 \
Akira Hatanakaefe96a62012-03-26 17:37:20 +000013// 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
Rafael Espindolafc3fc0c2012-10-09 20:46:28 +000018// RUN: %clang -c %s -### -o %t.o 2>&1 \
Akira Hatanakaefe96a62012-03-26 17:37:20 +000019// 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
Rafael Espindolafc3fc0c2012-10-09 20:46:28 +000026// RUN: %clang -c %s -### -o %t.o 2>&1 \
Akira Hatanakaefe96a62012-03-26 17:37:20 +000027// 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
Rafael Espindolafc3fc0c2012-10-09 20:46:28 +000032// RUN: %clang -c %s -### -o %t.o 2>&1 \
Akira Hatanakaefe96a62012-03-26 17:37:20 +000033// 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
Rafael Espindolafc3fc0c2012-10-09 20:46:28 +000040// RUN: %clang -c %s -### -o %t.o 2>&1 \
Akira Hatanakaefe96a62012-03-26 17:37:20 +000041// 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"
Simon Atanasyan81c423c2013-01-10 12:36:19 +000044//
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"