make/tests/scripts/features/varnesting
Paul Smith 38b19976f5 Fix issues found by ASAN and Coverity
* tests/test_driver.pl: Preserve the LSAN_OPTIONS variable.
* tests/scripts/targets/ONESHELL: Don't set a local variable.
* tests/scripts/functions/let: Test empty let variable.
* src/posixos.c (osync_parse_mutex): Free existing osync_tmpfile.
* src/misc.c (get_tmpfd): Set umask() before invoking mkstemp().
* src/ar.c (ar_parse_name): Check invalid name (shouldn't happen).
* src/function.c (define_new_function): Free previous function entry
when replacing it with a new one.
* src/job.c (child_execute_job): Initialize pid for safety.
(construct_command_argv_internal): In oneshell mode ensure that the
returned argv has the right format (0th element is a pointer to the
entire buffer).
2022-10-31 02:23:04 -04:00

27 lines
624 B
Perl

# -*-perl-*-
$description = "Test recursive variables";
$details = "";
run_make_test('
x = variable1
variable2 := Hello
y = $(subst 1,2,$(x))
z = y
a := $($($(z)))
all: ; @echo $(a)
',
'', "Hello\n");
# This tests resetting the value of a variable while expanding it.
# You may only see problems with this if you're using valgrind or
# some other memory checker that poisons freed memory.
# See Savannah patch #7534
run_make_test('
VARIABLE = $(eval VARIABLE := echo hi)$(VARIABLE)
wololo: ; @$(VARIABLE)
',
'', "hi\n");
1;