| 1 |
# -*-perl-*- |
| 2 |
$description = "Test recursive variables"; |
| 3 |
|
| 4 |
$details = ""; |
| 5 |
|
| 6 |
run_make_test(' |
| 7 |
x = variable1 |
| 8 |
variable2 := Hello |
| 9 |
y = $(subst 1,2,$(x)) |
| 10 |
z = y |
| 11 |
a := $($($(z))) |
| 12 |
all: ; @echo $(a) |
| 13 |
', |
| 14 |
'', "Hello\n"); |
| 15 |
|
| 16 |
# This tests resetting the value of a variable while expanding it. |
| 17 |
# You may only see problems with this if you're using valgrind or |
| 18 |
# some other memory checker that poisons freed memory. |
| 19 |
# See Savannah patch #7534 |
| 20 |
|
| 21 |
run_make_test(' |
| 22 |
VARIABLE = $(eval VARIABLE := echo hi)$(VARIABLE) |
| 23 |
wololo: ; @$(VARIABLE) |
| 24 |
', |
| 25 |
'', "hi\n"); |
| 26 |
|
| 27 |
1; |