shithub: scc

Download patch

ref: 3731792b164223503a4bca4f94a10d0dda63a59f
parent: 30a206ccf778fd87149c44335476c2c1962ce151
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Sat Oct 30 18:42:07 EDT 2021

tests/libc: Enable use of external CC

After this change the invocation of make can modify
the value of CC and select scc or the cc wrapper script.
This can help to test scc using the scc c99 libc.

--- a/tests/libc/execute/Makefile
+++ b/tests/libc/execute/Makefile
@@ -1,19 +1,14 @@
 .POSIX:
 
-ROOT   = ../../..
-CFLAGS =
-CC     = SCCPREFIX=$(ROOT) ./cc.sh
+CC     = ./cc.sh
 
 .c:
 	$(CC) $(CFLAGS) -o $@ $<
 
-all: tests-amd64
+all: tests
 
-tests-i386:
-	@SCCPREFIX=$(ROOT) CFLAGS='-a i386' ./chktest.sh libc-tests.lst
-
-tests-amd64:
-	@SCCPREFIX=$(ROOT) CFLAGS='-a amd64' ./chktest.sh libc-tests.lst
+tests:
+	@CC=$(CC) ./chktest.sh libc-tests.lst
 
 clean:
 	rm -f *.o *core test.log `awk '{print $$1}' libc-tests.lst`
--- a/tests/libc/execute/chktest.sh
+++ b/tests/libc/execute/chktest.sh
@@ -13,7 +13,7 @@
 	rm -f *.o $tmp1 $tmp2
 
 	(echo $i
-	 ./cc.sh $CFLAGS -o $i $i.c
+	 $CC $CFLAGS -o $i $i.c
 	 echo '/^output:$/+;/^end:$/-'w $tmp1 | ed -s $i.c
 	 ./$i > $tmp2 2>&1
 	 diff -u $tmp1 $tmp2) >> test.log 2>&1 &&