[cfe-commits] r153449 - /cfe/trunk/test/Driver/mips-float.c

Akira Hatanaka ahatanaka at mips.com
Mon Mar 26 10:37:20 PDT 2012


Author: ahatanak
Date: Mon Mar 26 12:37:20 2012
New Revision: 153449

URL: http://llvm.org/viewvc/llvm-project?rev=153449&view=rev
Log:
Test case for r153348.
 

Added:
    cfe/trunk/test/Driver/mips-float.c

Added: cfe/trunk/test/Driver/mips-float.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/mips-float.c?rev=153449&view=auto
==============================================================================
--- cfe/trunk/test/Driver/mips-float.c (added)
+++ cfe/trunk/test/Driver/mips-float.c Mon Mar 26 12:37:20 2012
@@ -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"





More information about the cfe-commits mailing list