Imported Upstream version 4.0
[platform/upstream/make.git] / tests / scripts / features / varnesting
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: 
13         @echo $(a)
14 ',
15               '', "Hello\n");
16
17 # This tests resetting the value of a variable while expanding it.
18 # You may only see problems with this if you're using valgrind or
19 # some other memory checker that poisons freed memory.
20 # See Savannah patch #7534
21
22 run_make_test('
23 VARIABLE = $(eval VARIABLE := echo hi)$(VARIABLE)
24 wololo:
25         @$(VARIABLE)
26 ',
27               '', "hi\n");
28
29 1;
30
31
32
33
34
35