From d82f3052c813f671561362126d0fbe08568542d3 Mon Sep 17 00:00:00 2001 From: lemon Date: Sat, 6 Dec 2025 11:41:44 +0100 Subject: add command-line predefined macros (-D, -U) --- test/07-pp.c | 6 ++++-- test/run.sh | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/07-pp.c b/test/07-pp.c index c26105d..6a50571 100644 --- a/test/07-pp.c +++ b/test/07-pp.c @@ -1,3 +1,4 @@ +/* CFLAGS: -D CMD_WORKING -DV=void */ /* EXPECT: ok /1 "\n"n ;.& 05.5 ADD(1,2) hi from header ;73 @@ -30,9 +31,10 @@ u\ t\ s - +#ifdef CMD_WORKING int -main(void) +main(V) +#endif { int CATl(foo); ++foobar; diff --git a/test/run.sh b/test/run.sh index 5e0bc0f..34d8101 100755 --- a/test/run.sh +++ b/test/run.sh @@ -16,11 +16,12 @@ run() { echo ---- $f ---- >> log.txt mkdir -p build/ args=$(awk '/\/\* ARGS:.*$/ {ORS=" ";for (i=3;i "$expected" if [ $? == 0 ]; then obj=build/"$(echo "$f" | sed -s 's/\.c$/.o/')" exe=build/"$(echo "$f" | sed -s 's/\.c$//')" - if ! ( x $ANTCC "$f" -c -o "$obj" && x $ANTCC "$obj" -o "$exe" ); then + if ! ( x $ANTCC $cflags "$f" -c -o "$obj" && x $ANTCC $cflags "$obj" -o "$exe" ); then echo !TEST ERROR $f echo !FAILED TO COMPILE echo '-------' -- cgit v1.2.3