Cross-compilers can be used by setting X_COMPILER, Y_COMPILER, and CC to
the compilers to be used. The tests can be executed using a RUNUNDER script
much like the test-suite.

Also added Makefiles for testing the MIPS O32/N32/N64 ABI's in big/little
endian as well as with hard/soft-float (via SOFTFLOAT=1)

http://reviews.llvm.org/D4810

Files:
  utils/ABITest/Makefile.test.common
  utils/ABITest/mips-n32/Makefile
  utils/ABITest/mips-n64/Makefile
  utils/ABITest/mips-o32/Makefile
  utils/ABITest/mipsel-n32/Makefile
  utils/ABITest/mipsel-n64/Makefile
  utils/ABITest/mipsel-o32/Makefile
Index: utils/ABITest/Makefile.test.common
===================================================================
--- utils/ABITest/Makefile.test.common
+++ utils/ABITest/Makefile.test.common
@@ -13,11 +13,11 @@
 
 CFLAGS := -std=gnu99
 
-X_COMPILER := gcc
+X_COMPILER ?= gcc
 X_LL_CFLAGS := -emit-llvm -S
-Y_COMPILER := clang
+Y_COMPILER ?= clang
 Y_LL_CFLAGS := -emit-llvm -S
-CC := gcc
+CC ?= gcc
 
 ###
 
@@ -84,7 +84,7 @@
 
 .PRECIOUS: temps/test.%.out
 temps/test.%.out: temps/test.%
-	-$(Verb) ./$< > $@
+	-$(Verb) $(RUNUNDER) ./$< > $@
 
 # Executables
 
Index: utils/ABITest/mips-n32/Makefile
===================================================================
--- /dev/null
+++ utils/ABITest/mips-n32/Makefile
@@ -0,0 +1,24 @@
+CC := mips-img-linux-gnu-gcc
+X_COMPILER := mips-img-linux-gnu-gcc
+Y_COMPILER := mips64-img-linux-gnu-clang
+
+X_CFLAGS := -mips64r6 -mabi=n32
+Y_CFLAGS := -mips64r6 -mabi=n32 -gcc-toolchain /home/das/mips/workspaces/mips64r6/gcc-toolchain/install-mips-img-linux-gnu
+CC_CFLAGS := -mips64r6 -mabi=n32
+
+# There are 16 argument registers so testing 18 arguments will cover every
+# possibility.
+N_ARGS = 18
+ifeq (${SOFTFLOAT},1)
+  # Softfloat causes the floating point arguments to occupy integer registers
+  # so we don't need to test as many. There are 8 remaining registers so
+  # testing 10 covers everything.
+  N_ARGS = 10
+  X_CFLAGS := ${X_CFLAGS} -msoft-float
+  Y_CFLAGS := ${Y_CFLAGS} -msoft-float
+  CC_CFLAGS := ${CC_CFLAGS} -msoft-float
+endif
+
+include ../Makefile.test.common
+
+TESTARGS += --max-args ${N_ARGS}
Index: utils/ABITest/mips-n64/Makefile
===================================================================
--- /dev/null
+++ utils/ABITest/mips-n64/Makefile
@@ -0,0 +1,24 @@
+CC := mips-img-linux-gnu-gcc
+X_COMPILER := mips-img-linux-gnu-gcc
+Y_COMPILER := mips64-img-linux-gnu-clang
+
+X_CFLAGS := -mips64r6 -mabi=64
+Y_CFLAGS := -mips64r6 -mabi=64 -gcc-toolchain /home/das/mips/workspaces/mips64r6/gcc-toolchain/install-mips-img-linux-gnu
+CC_CFLAGS := -mips64r6 -mabi=64
+
+# There are 16 argument registers so testing 18 arguments will cover every
+# possibility.
+N_ARGS = 18
+ifeq (${SOFTFLOAT},1)
+  # Softfloat causes the floating point arguments to occupy integer registers
+  # so we don't need to test as many. There are 8 remaining registers so
+  # testing 10 covers everything.
+  N_ARGS = 10
+  X_CFLAGS := ${X_CFLAGS} -msoft-float
+  Y_CFLAGS := ${Y_CFLAGS} -msoft-float
+  CC_CFLAGS := ${CC_CFLAGS} -msoft-float
+endif
+
+include ../Makefile.test.common
+
+TESTARGS += --max-args ${N_ARGS}
Index: utils/ABITest/mips-o32/Makefile
===================================================================
--- /dev/null
+++ utils/ABITest/mips-o32/Makefile
@@ -0,0 +1,18 @@
+CC := mips-img-linux-gnu-gcc
+X_COMPILER := mips-img-linux-gnu-gcc
+Y_COMPILER := mips-img-linux-gnu-clang
+
+X_CFLAGS := -mips32r6
+Y_CFLAGS := -mips32r6 -gcc-toolchain /home/das/mips/workspaces/mips64r6/gcc-toolchain/install-mips-img-linux-gnu
+CC_CFLAGS := -mips32r6
+
+N_ARGS = 4
+ifeq (${SOFTFLOAT},1)
+  X_CFLAGS := ${X_CFLAGS} -msoft-float
+  Y_CFLAGS := ${Y_CFLAGS} -msoft-float
+  CC_CFLAGS := ${CC_CFLAGS} -msoft-float
+endif
+
+include ../Makefile.test.common
+
+TESTARGS += --max-args ${N_ARGS}
Index: utils/ABITest/mipsel-n32/Makefile
===================================================================
--- /dev/null
+++ utils/ABITest/mipsel-n32/Makefile
@@ -0,0 +1,24 @@
+CC := mips-img-linux-gnu-gcc
+X_COMPILER := mips-img-linux-gnu-gcc
+Y_COMPILER := mips64-img-linux-gnu-clang
+
+X_CFLAGS := -EL -mips64r6 -mabi=n32
+Y_CFLAGS := -EL -mips64r6 -mabi=n32 -gcc-toolchain /home/das/mips/workspaces/mips64r6/gcc-toolchain/install-mips-img-linux-gnu
+CC_CFLAGS := -EL -mips64r6 -mabi=n32
+
+# There are 16 argument registers so testing 18 arguments will cover every
+# possibility.
+N_ARGS = 18
+ifeq (${SOFTFLOAT},1)
+  # Softfloat causes the floating point arguments to occupy integer registers
+  # so we don't need to test as many. There are 8 remaining registers so
+  # testing 10 covers everything.
+  N_ARGS = 10
+  X_CFLAGS := ${X_CFLAGS} -msoft-float
+  Y_CFLAGS := ${Y_CFLAGS} -msoft-float
+  CC_CFLAGS := ${CC_CFLAGS} -msoft-float
+endif
+
+include ../Makefile.test.common
+
+TESTARGS += --max-args ${N_ARGS}
Index: utils/ABITest/mipsel-n64/Makefile
===================================================================
--- /dev/null
+++ utils/ABITest/mipsel-n64/Makefile
@@ -0,0 +1,24 @@
+CC := mips-img-linux-gnu-gcc
+X_COMPILER := mips-img-linux-gnu-gcc
+Y_COMPILER := mips64-img-linux-gnu-clang
+
+X_CFLAGS := -EL -mips64r6 -mabi=64
+Y_CFLAGS := -EL -mips64r6 -mabi=64 -gcc-toolchain /home/das/mips/workspaces/mips64r6/gcc-toolchain/install-mips-img-linux-gnu
+CC_CFLAGS := -EL -mips64r6 -mabi=64
+
+# There are 16 argument registers so testing 18 arguments will cover every
+# possibility.
+N_ARGS = 18
+ifeq (${SOFTFLOAT},1)
+  # Softfloat causes the floating point arguments to occupy integer registers
+  # so we don't need to test as many. There are 8 remaining registers so
+  # testing 10 covers everything.
+  N_ARGS = 10
+  X_CFLAGS := ${X_CFLAGS} -msoft-float
+  Y_CFLAGS := ${Y_CFLAGS} -msoft-float
+  CC_CFLAGS := ${CC_CFLAGS} -msoft-float
+endif
+
+include ../Makefile.test.common
+
+TESTARGS += --max-args ${N_ARGS}
Index: utils/ABITest/mipsel-o32/Makefile
===================================================================
--- /dev/null
+++ utils/ABITest/mipsel-o32/Makefile
@@ -0,0 +1,18 @@
+CC := mips-img-linux-gnu-gcc
+X_COMPILER := mips-img-linux-gnu-gcc
+Y_COMPILER := mips-img-linux-gnu-clang
+
+X_CFLAGS := -EL -mips32r6
+Y_CFLAGS := -EL -mips32r6 -gcc-toolchain /home/das/mips/workspaces/mips64r6/gcc-toolchain/install-mips-img-linux-gnu
+CC_CFLAGS := -EL -mips32r6
+
+N_ARGS = 4
+ifeq (${SOFTFLOAT},1)
+  X_CFLAGS := ${X_CFLAGS} -msoft-float
+  Y_CFLAGS := ${Y_CFLAGS} -msoft-float
+  CC_CFLAGS := ${CC_CFLAGS} -msoft-float
+endif
+
+include ../Makefile.test.common
+
+TESTARGS += --max-args ${N_ARGS}
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to