diff --git a/tests/scripts/features/se_implicit b/tests/scripts/features/se_implicit index 07ce802..db6e168 100644 --- a/tests/scripts/features/se_implicit +++ b/tests/scripts/features/se_implicit @@ -325,5 +325,103 @@ unlink('hello.x'); unlink('hello.tsk'); +# sv 60659. Second expansion of automatic variables inside a function in the +# prerequisite list. +# $$@ expands to the target in the 1st and following rules. +# $$* expands to the stem 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. +# $$% cannot be used in prerequisites, because in pattern rules % is +# substituted for stem. + + +# subtest 1. Pattern rules. 1st rule. +run_make_test(q! +.SECONDEXPANSION: +all: 2.x +%.x: 5.z 6.z 5.z $$(info @=$$@,<=$$<,^=$$^,+=$$+,|=$$|,?=$$?,*=$$*) ; +%.z: ; +!, '', +"@=2.x,<=,^=,+=,|=,?=,*=2 +#MAKE#: Nothing to be done for 'all'.\n"); + + +# subtest 2. Pattern 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 +%.x: 9.z $$(info @=$$@,<=$$<,^=$$^,+=$$+,|=$$|,?=$$?,*=$$*) ; +%.z: ; +!, '', +"@=2.x,<=5.z,^=5.z 6.z,+=5.z 6.z 5.z,|=7.z 8.z,?=,*=2 +@=1.x,<=1.z,^=1.z 2.z,+=1.z 2.z 2.z,|=3.z 4.z,?=,*=1 +#MAKE#: Nothing to be done for 'all'.\n"); + + +# subtest 3. Static pattern rules. 1st rule. +run_make_test(q! +.SECONDEXPANSION: +all: 2.x +2.x: %.x: 5.z 6.z 5.z $$(info @=$$@,<=$$<,^=$$^,+=$$+,|=$$|,?=$$?,*=$$*) ; +%.z: ; +!, '', +"@=2.x,<=,^=,+=,|=,?=,*=2 +#MAKE#: Nothing to be done for 'all'.\n"); + + +# subtest 4. Static pattern 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: %.x: 9.z $$(info @=$$@,<=$$<,^=$$^,+=$$+,|=$$|,?=$$?,*=$$*) ; +%.z: ; +!, '', +"@=2.x,<=5.z,^=5.z 6.z,+=5.z 6.z 5.z,|=7.z 8.z,?=,*=2 +@=1.x,<=1.z,^=1.z 2.z,+=1.z 2.z 2.z,|=3.z 4.z,?=,*=1 +#MAKE#: Nothing to be done for 'all'.\n"); + + +# subtest 5. Grouped targets in implicit rules. 1st rule. +run_make_test(q! +.SECONDEXPANSION: +all: 2.x +%.x %.xx&: 5.z 6.z 5.z $$(info @=$$@,<=$$<,^=$$^,+=$$+,|=$$|,?=$$?,*=$$*) ; +%.z: ; +!, '', +"@=2.x,<=,^=,+=,|=,?=,*=2 +#MAKE#: Nothing to be done for 'all'.\n"); + + +# subtest 6. Grouped targets in implicit rules. 2nd rule. +run_make_test(q! +.SECONDEXPANSION: +all: 2.x 1.xx +2.x: 5.z 6.z 5.z | 7.z 7.z 8.z +1.xx: 1.z 2.z 2.z | 3.z 4.z +%.x %.xx&: 9.z $$(info @=$$@,<=$$<,^=$$^,+=$$+,|=$$|,?=$$?,*=$$*) ; +%.z: ; +!, '', +"@=2.x,<=5.z,^=5.z 6.z,+=5.z 6.z 5.z,|=7.z 8.z,?=,*=2 +@=1.xx,<=1.z,^=1.z 2.z,+=1.z 2.z 2.z,|=3.z 4.z,?=,*=1 +#MAKE#: Nothing to be done for 'all'.\n"); + + +# subtest 7. Double colon rule. +run_make_test(q! +.SECONDEXPANSION: +all: 2.x +%.x:: 5.z 6.z 5.z $$(info @=$$@,<=$$<,^=$$^,+=$$+,|=$$|,?=$$?,*=$$*) ; +5.z 6.z: ; +!, '', +"@=2.x,<=,^=,+=,|=,?=,*=2 +#MAKE#: Nothing to be done for 'all'.\n"); + + # This tells the test driver that the perl test script executed properly. 1;