blob: c205f5db17ec1432c7d79e9422b3c904a3137ae1 [file] [log] [blame]
Brad Smith10cd0f42014-07-11 20:12:08 +00001// Check handling -mhard-float / -msoft-float options
2// when build for SPARC platforms.
3//
4// Default sparc
5// RUN: %clang -c %s -### -o %t.o 2>&1 \
6// RUN: -target sparc-linux-gnu \
7// RUN: | FileCheck --check-prefix=CHECK-DEF %s
James Y Knightb2406522015-06-15 20:51:24 +00008// CHECK-DEF-NOT: "-target-feature" "+soft-float"
9// CHECK-DEF-NOT: "-msoft-float"
Brad Smith10cd0f42014-07-11 20:12:08 +000010//
11// -mhard-float
12// RUN: %clang -c %s -### -o %t.o 2>&1 \
13// RUN: -target sparc-linux-gnu -mhard-float \
14// RUN: | FileCheck --check-prefix=CHECK-HARD %s
James Y Knightb2406522015-06-15 20:51:24 +000015// CHECK-HARD-NOT: "-msoft-float"
Brad Smith10cd0f42014-07-11 20:12:08 +000016//
17// -msoft-float
18// RUN: %clang -c %s -### -o %t.o 2>&1 \
19// RUN: -target sparc-linux-gnu -msoft-float \
20// RUN: | FileCheck --check-prefix=CHECK-SOFT %s
Jacob Baungard Hansen13a49372016-05-24 08:30:08 +000021// CHECK-SOFT: "-target-feature" "+soft-float"
22//
23// -mfloat-abi=soft
24// RUN: %clang -c %s -### -o %t.o 2>&1 \
25// RUN: -target sparc-linux-gnu -mfloat-abi=soft \
26// RUN: | FileCheck --check-prefix=CHECK-FLOATABISOFT %s
27// CHECK-FLOATABISOFT: "-target-feature" "+soft-float"
28//
29// -mfloat-abi=hard
30// RUN: %clang -c %s -### -o %t.o 2>&1 \
31// RUN: -target sparc-linux-gnu -mfloat-abi=hard \
32// RUN: | FileCheck --check-prefix=CHECK-FLOATABIHARD %s
33// CHECK-FLOATABIHARD-NOT: "-target-feature" "+soft-float"
34//
35// check invalid -mfloat-abi
36// RUN: %clang -c %s -### -o %t.o 2>&1 \
37// RUN: -target sparc-linux-gnu -mfloat-abi=x \
38// RUN: | FileCheck --check-prefix=CHECK-ERRMSG %s
39// CHECK-ERRMSG: error: invalid float ABI '-mfloat-abi=x'
Brad Smith10cd0f42014-07-11 20:12:08 +000040//
41// Default sparc64
42// RUN: %clang -c %s -### -o %t.o 2>&1 \
43// RUN: -target sparc64-linux-gnu \
44// RUN: | FileCheck --check-prefix=CHECK-DEF-SPARC64 %s
James Y Knightb2406522015-06-15 20:51:24 +000045// CHECK-DEF-SPARC64-NOT: "-target-feature" "+soft-float"
46// CHECK-DEF-SPARC64-NOT: "-msoft-float"
Brad Smith10cd0f42014-07-11 20:12:08 +000047//
48// -mhard-float
49// RUN: %clang -c %s -### -o %t.o 2>&1 \
50// RUN: -target sparc64-linux-gnu -mhard-float \
51// RUN: | FileCheck --check-prefix=CHECK-HARD-SPARC64 %s
James Y Knightb2406522015-06-15 20:51:24 +000052// CHECK-HARD-SPARC64-NOT: "-msoft-float"
Brad Smith10cd0f42014-07-11 20:12:08 +000053//
54// -msoft-float
55// RUN: %clang -c %s -### -o %t.o 2>&1 \
56// RUN: -target sparc64-linux-gnu -msoft-float \
57// RUN: | FileCheck --check-prefix=CHECK-SOFT-SPARC64 %s
Jacob Baungard Hansen13a49372016-05-24 08:30:08 +000058// CHECK-SOFT-SPARC64: "-target-feature" "+soft-float"
59//
60// -mfloat-abi=soft
61// RUN: %clang -c %s -### -o %t.o 2>&1 \
62// RUN: -target sparc64-linux-gnu -mfloat-abi=soft \
63// RUN: | FileCheck --check-prefix=CHECK-FLOATABISOFT64 %s
64// CHECK-FLOATABISOFT64: "-target-feature" "+soft-float"
65//
66// -mfloat-abi=hard
67// RUN: %clang -c %s -### -o %t.o 2>&1 \
68// RUN: -target sparc64-linux-gnu -mfloat-abi=hard \
69// RUN: | FileCheck --check-prefix=CHECK-FLOATABIHARD64 %s
70// CHECK-FLOATABIHARD64-NOT: "-target-feature" "+soft-float"
71//
72// check invalid -mfloat-abi
73// RUN: %clang -c %s -### -o %t.o 2>&1 \
74// RUN: -target sparc64-linux-gnu -mfloat-abi=x \
75// RUN: | FileCheck --check-prefix=CHECK-ERRMSG64 %s
76// CHECK-ERRMSG64: error: invalid float ABI '-mfloat-abi=x'