diff --git a/tests/scripts/features/se_explicit b/tests/scripts/features/se_explicit index c28641c..450aaf7 100644 --- a/tests/scripts/features/se_explicit +++ b/tests/scripts/features/se_explicit @@ -200,4 +200,96 @@ biz: $$(info $$<) !, '', "baz\n#MAKE#: Nothing to be done for 'biz'.\n"); + +# sv 60659. Second expansion of automatic variables inside a function in the +# prerequisite list. +# $$@ expands to the target in the 1st and following rules. +# $$<,$$^,$$+,$$|,$$?,$$*,$$% expand to the empty string in the prerequisite +# list of the 1st rule. +# $$<,$$^,$$+,$$|,$$?,$$*,$$% in the prerequisite list of the 2nd (and +# following) rule expand to the values from the 1st rule. + + +# subtest 1. Explicit rules. 1st rule. +run_make_test(q! +.SECONDEXPANSION: +all: 2.x +2.x: 5.z 6.z 5.z $$(info @=$$@,<=$$<,^=$$^,+=$$+,|=$$|,?=$$?,*=$$*,%=$$%) ; +%.z: ; +!, '', +"@=2.x,<=,^=,+=,|=,?=,*=,%= +#MAKE#: Nothing to be done for 'all'.\n"); + + +# subtest 2. Explicit rules. 2nd rule. +run_make_test(q! +.SECONDEXPANSION: +all: 2.x 1.x +2.x: 5.z 6.z 5.z | 7.z 7.z 8.z +1.x: 1.z 2.z 2.z | 3.z 4.z +2.x 1.x: 9.z $$(info @=$$@,<=$$<,^=$$^,+=$$+,|=$$|,?=$$?,*=$$*,%=$$%) ; +%.z: ; +!, '', +"@=2.x,<=5.z,^=5.z 6.z,+=5.z 6.z 5.z,|=7.z 8.z,?=,*=,%= +@=1.x,<=1.z,^=1.z 2.z,+=1.z 2.z 2.z,|=3.z 4.z,?=,*=,%= +#MAKE#: Nothing to be done for 'all'.\n"); + + +# subtest 3. Grouped targets in explicit rules. 1st rule. +run_make_test(q! +.SECONDEXPANSION: +all: 2.x +2.x 1.x&: 5.z 6.z 5.z $$(info @=$$@,<=$$<,^=$$^,+=$$+,|=$$|,?=$$?,*=$$*,%=$$%) ; +%.z: ; +!, '', +"@=2.x,<=,^=,+=,|=,?=,*=,%= +@=1.x,<=,^=,+=,|=,?=,*=,%= +#MAKE#: Nothing to be done for 'all'.\n"); + + +# subtest 4. Grouped targets in explicit rules. 2nd rule. +run_make_test(q! +.SECONDEXPANSION: +all: 2.x 1.x +2.x: 5.z 6.z 5.z | 7.z 7.z 8.z +1.x: 1.z 2.z 2.z | 3.z 4.z +2.x 1.x&: 9.z $$(info @=$$@,<=$$<,^=$$^,+=$$+,|=$$|,?=$$?,*=$$*,%=$$%) ; +%.z: ; +!, '', +"@=2.x,<=5.z,^=5.z 6.z,+=5.z 6.z 5.z,|=7.z 8.z,?=,*=,%= +@=1.x,<=1.z,^=1.z 2.z,+=1.z 2.z 2.z,|=3.z 4.z,?=,*=,%= +#MAKE#: Nothing to be done for 'all'.\n"); + + +# Double colon rules. +# Because each double colon rule is independent of the other double colon rules +# for the same target, each automatic variable in the prerequisite list, other +# than $$@, second expands to the empty string in any rule, 1st, 2nd or later. + +# subtest 5. 1st double colon rule. +run_make_test(q! +.SECONDEXPANSION: +all: 2.x +2.x:: 5.z 6.z 5.z $$(info @=$$@,<=$$<,^=$$^,+=$$+,|=$$|,?=$$?,*=$$*,%=$$%) ; +%.z: ; +!, '', +"@=2.x,<=,^=,+=,|=,?=,*=,%= +#MAKE#: Nothing to be done for 'all'.\n"); + + +# subtest 6. 2nd double colon rule. +run_make_test(q! +.SECONDEXPANSION: +all: 2.x 1.x +2.x:: 5.z 6.z 5.z | 7.z 7.z 8.z ; +1.x:: 1.z 2.z 2.z | 3.z 4.z ; +2.x 1.x:: 9.z $$(info @=$$@,<=$$<,^=$$^,+=$$+,|=$$|,?=$$?,*=$$*,%=$$%) ; +%.z: ; +!, '', +"@=2.x,<=,^=,+=,|=,?=,*=,%= +@=1.x,<=,^=,+=,|=,?=,*=,%= +#MAKE#: Nothing to be done for 'all'.\n"); + + + 1;