]> granicus.if.org Git - clang/commitdiff
Test case for r153348.
authorAkira Hatanaka <ahatanaka@mips.com>
Mon, 26 Mar 2012 17:37:20 +0000 (17:37 +0000)
committerAkira Hatanaka <ahatanaka@mips.com>
Mon, 26 Mar 2012 17:37:20 +0000 (17:37 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153449 91177308-0d34-0410-b5e6-96231b3b80d8

test/Driver/mips-float.c [new file with mode: 0644]

diff --git a/test/Driver/mips-float.c b/test/Driver/mips-float.c
new file mode 100644 (file)
index 0000000..4a666ee
--- /dev/null
@@ -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"