[hackers] [scc] Add a test script to incrementally self host. || Andrew Chambers
commit 887f13a8d9d9abdd6a14d6815f0a6a7d3f94073f
Author: Andrew Chambers <andrewchamberss_AT_gmail.com>
AuthorDate: Thu Feb 16 20:53:42 2017 +1300
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Thu Feb 16 09:18:37 2017 +0100
Add a test script to incrementally self host.
diff --git a/tests/selfhost.sh b/tests/selfhost.sh
new file mode 100755
index 0000000..ec24d81
--- /dev/null
+++ b/tests/selfhost.sh
_AT_@ -0,0 +1,67 @@
+#! /bin/sh
+
+# A script to self host whatever object files that we can as a regression test.
+# One day it can be replaced with:
+# make install && make clean && make CC=scc install
+
+set -e
+set -u
+
+unset SCCEXECPATH
+
+selfhostedobj=\
+"lib/debug.o
+ lib/die.o
+ lib/newitem.o
+ lib/xstrdup.o
+ lib/xmalloc.o
+ lib/xcalloc.o
+ lib/xrealloc.o"
+#driver/posix/scc.o
+#cc1/error.o
+#cc1/stmt.o
+#cc1/init.o
+#cc1/arch/qbe/arch.o
+#cc1/fold.o
+#cc1/types.o
+#cc1/builtin.o
+#cc1/cpp.o
+#cc1/symbol.o
+#cc1/lex.o
+#cc1/decl.o
+#cc1/main.o
+#cc1/code.o
+#cc1/expr.o
+#cc2/arch/qbe/cgen.o
+#cc2/arch/qbe/types.o
+#cc2/arch/qbe/optm.o
+#cc2/arch/qbe/code.o
+#cc2/peep.o
+#cc2/parser.o
+#cc2/node.o
+#cc2/symbol.o
+#cc2/optm.o
+#cc2/main.o
+#cc2/code.o"
+
+if ! test -d ./cc1
+then
+ echo "run this script from the root of the scc repository."
+ exit 1
+fi
+
+boostrapdir="$(pwd)/_bootstrap"
+rm -rf "$boostrapdir"
+mkdir "$boostrapdir"
+
+make clean
+make PREFIX="$boostrapdir" install
+export PATH="$boostrapdir/bin:$PATH"
+
+rm bin/scc bin/cc*
+for o in $selfhostedobj
+do
+ rm $o
+done
+
+make CC=scc tests
Received on Thu Feb 16 2017 - 09:18:44 CET
This archive was generated by hypermail 2.3.0
: Thu Feb 16 2017 - 09:24:18 CET