| 1 |
// Check handling -mhard-float / -msoft-float options |
| 2 |
// when build for SystemZ platforms. |
| 3 |
// |
| 4 |
// Default |
| 5 |
// RUN: %clang -c %s -### -o %t.o 2>&1 \ |
| 6 |
// RUN: -target s390x-linux-gnu \ |
| 7 |
// RUN: | FileCheck --check-prefix=CHECK-DEF %s |
| 8 |
// CHECK-DEF-NOT: "-msoft-float" |
| 9 |
// CHECK-DEF-NOT: "-mfloat-abi" "soft" |
| 10 |
// |
| 11 |
// -mhard-float |
| 12 |
// RUN: %clang -c %s -### -o %t.o 2>&1 \ |
| 13 |
// RUN: -target s390x-linux-gnu -mhard-float \ |
| 14 |
// RUN: | FileCheck --check-prefix=CHECK-HARD %s |
| 15 |
// CHECK-HARD-NOT: "-msoft-float" |
| 16 |
// CHECK-HARD-NOT: "-mfloat-abi" "soft" |
| 17 |
// |
| 18 |
// -msoft-float |
| 19 |
// RUN: %clang -c %s -### -o %t.o 2>&1 \ |
| 20 |
// RUN: -target s390x-linux-gnu -msoft-float \ |
| 21 |
// RUN: | FileCheck --check-prefix=CHECK-SOFT %s |
| 22 |
// CHECK-SOFT: "-msoft-float" "-mfloat-abi" "soft" |
| 23 |
// |
| 24 |
// -mfloat-abi=soft |
| 25 |
// RUN: not %clang -c %s -### -o %t.o 2>&1 \ |
| 26 |
// RUN: -target s390x-linux-gnu -mfloat-abi=soft \ |
| 27 |
// RUN: | FileCheck --check-prefix=CHECK-FLOATABISOFT %s |
| 28 |
// CHECK-FLOATABISOFT: error: unsupported option '-mfloat-abi=soft' |
| 29 |
// |
| 30 |
// -mfloat-abi=hard |
| 31 |
// RUN: not %clang -c %s -### -o %t.o 2>&1 \ |
| 32 |
// RUN: -target s390x-linux-gnu -mfloat-abi=hard \ |
| 33 |
// RUN: | FileCheck --check-prefix=CHECK-FLOATABIHARD %s |
| 34 |
// CHECK-FLOATABIHARD: error: unsupported option '-mfloat-abi=hard' |
| 35 |
// |
| 36 |
// check invalid -mfloat-abi |
| 37 |
// RUN: not %clang -c %s -### -o %t.o 2>&1 \ |
| 38 |
// RUN: -target s390x-linux-gnu -mfloat-abi=x \ |
| 39 |
// RUN: | FileCheck --check-prefix=CHECK-ERRMSG %s |
| 40 |
// CHECK-ERRMSG: error: unsupported option '-mfloat-abi=x' |
| 41 |
|
| 42 |
int foo(void) { |
| 43 |
return 0; |
| 44 |
} |
| 45 |
|