From 54edd4764db4c266359f757daabdb0189199e4ed Mon Sep 17 00:00:00 2001 From: Akira Hatanaka Date: Mon, 26 Mar 2012 17:37:20 +0000 Subject: [PATCH] Test case for r153348. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153449 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Driver/mips-float.c | 59 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 test/Driver/mips-float.c diff --git a/test/Driver/mips-float.c b/test/Driver/mips-float.c new file mode 100644 index 0000000000..4a666eefaf --- /dev/null +++ b/test/Driver/mips-float.c @@ -0,0 +1,59 @@ +// Check handling -mhard-float / -msoft-float / -mfloat-abi options +// when build for MIPS platforms. +// +// Default +// RUN: %clang -c %s -### -o %t.o 2>&1 \ +// RUN: -target mips-linux-gnu \ +// RUN: | FileCheck --check-prefix=CHECK-DEF %s +// CHECK-DEF: "-mfloat-abi" "hard" +// +// -mhard-float +// RUN: %clang -c %s -### -o %t.o 2>&1 \ +// RUN: -target mips-linux-gnu -mhard-float \ +// RUN: | FileCheck --check-prefix=CHECK-HARD %s +// CHECK-HARD: "-mfloat-abi" "hard" +// +// -msoft-float +// RUN: %clang -c %s -### -o %t.o 2>&1 \ +// RUN: -target mips-linux-gnu -msoft-float \ +// RUN: | FileCheck --check-prefix=CHECK-SOFT %s +// CHECK-SOFT: "-msoft-float" +// CHECK-SOFT: "-mfloat-abi" "soft" +// CHECK-SOFT: "-target-feature" "+soft-float" +// +// -mfloat-abi=hard +// RUN: %clang -c %s -### -o %t.o 2>&1 \ +// RUN: -target mips-linux-gnu -mfloat-abi=hard \ +// RUN: | FileCheck --check-prefix=CHECK-ABI-HARD %s +// CHECK-ABI-HARD: "-mfloat-abi" "hard" +// +// -mfloat-abi=soft +// RUN: %clang -c %s -### -o %t.o 2>&1 \ +// RUN: -target mips-linux-gnu -mfloat-abi=soft \ +// RUN: | FileCheck --check-prefix=CHECK-ABI-SOFT %s +// CHECK-ABI-SOFT: "-msoft-float" +// CHECK-ABI-SOFT: "-mfloat-abi" "soft" +// CHECK-ABI-SOFT: "-target-feature" "+soft-float" +// +// -mfloat-abi=single +// RUN: %clang -c %s -### -o %t.o 2>&1 \ +// RUN: -target mips-linux-gnu -mfloat-abi=single \ +// RUN: | FileCheck --check-prefix=CHECK-ABI-SINGLE %s +// CHECK-ABI-SINGLE: "-target-feature" "+single-float" +// +// Let's check float ABI related macros. +// +// -mfloat-abi=hard +// RUN: %clang -c %s -dM -E 2>&1 \ +// RUN: -target mips-linux-gnu -mfloat-abi=hard \ +// RUN: | grep "#define __mips_hard_float 1" +// +// -mfloat-abi=soft +// RUN: %clang -c %s -dM -E 2>&1 \ +// RUN: -target mips-linux-gnu -mfloat-abi=soft \ +// RUN: | grep "#define __mips_soft_float 1" +// +// -mfloat-abi=single +// RUN: %clang -c %s -dM -E 2>&1 \ +// RUN: -target mips-linux-gnu -mfloat-abi=single \ +// RUN: | grep "#define __mips_single_float 1" -- 2.40.0