From d15a484098a52e0784933ba03a98445fdc86ea3f Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Wed, 22 Jan 2003 13:45:44 +0000 Subject: Fix bug #1744: mask extra arguments to recursive invocations of $(call ...) --- tests/ChangeLog | 5 +++++ tests/scripts/functions/call | 31 +++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) (limited to 'tests') diff --git a/tests/ChangeLog b/tests/ChangeLog index e91ccc9..2533bb8 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,8 @@ +2003-01-22 Paul D. Smith + + * scripts/functions/call: Test recursive argument masking (bug + #1744). + 2002-10-25 Paul D. Smith * scripts/functions/eval: Test using $(eval ...) inside diff --git a/tests/scripts/functions/call b/tests/scripts/functions/call index a8834cd..efee476 100644 --- a/tests/scripts/functions/call +++ b/tests/scripts/functions/call @@ -69,4 +69,35 @@ $answer = "foo bar\ndefault file file\nb d f\n\n\nb\nbar foo baz\nfoo bar baz bl &compare_output($answer, &get_logfile(1)); + +# TEST eclipsing of arguments when invoking sub-calls + +$makefile2 = &get_tmpfile; + +open(MAKEFILE,"> $makefile2"); + +print MAKEFILE <<'EOF'; + +all = $1 $2 $3 $4 $5 $6 $7 $8 $9 + +level1 = $(call all,$1,$2,$3,$4,$5) +level2 = $(call level1,$1,$2,$3) +level3 = $(call level2,$1,$2,$3,$4,$5) + +all: + @echo $(call all,1,2,3,4,5,6,7,8,9,10,11) + @echo $(call level1,1,2,3,4,5,6,7,8) + @echo $(call level2,1,2,3,4,5,6,7,8) + @echo $(call level3,1,2,3,4,5,6,7,8) +EOF + +close(MAKEFILE); + +&run_make_with_options($makefile2, "", &get_logfile); + +# Create the answer to what should be produced by this Makefile +$answer = "1 2 3 4 5 6 7 8 9\n1 2 3 4 5\n1 2 3\n1 2 3\n"; + +&compare_output($answer,&get_logfile(1)); + 1; -- cgit v1.2.3