From 514845e5f21a64ae526f108fdac4a97ca293f872 Mon Sep 17 00:00:00 2001 From: rillig Date: Sun, 27 Dec 2020 18:20:26 +0000 Subject: [PATCH] make(1): add test for ParseDependencyTargetWord --- usr.bin/make/unit-tests/deptgt.exp | 1 + usr.bin/make/unit-tests/deptgt.mk | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/usr.bin/make/unit-tests/deptgt.exp b/usr.bin/make/unit-tests/deptgt.exp index fee0563f5b37..b2aeaa5a2850 100644 --- a/usr.bin/make/unit-tests/deptgt.exp +++ b/usr.bin/make/unit-tests/deptgt.exp @@ -8,6 +8,7 @@ ParseDoDependency(: empty-source) ParseReadLine (37): ' : command for empty targets list' ParseReadLine (38): '.MAKEFLAGS: -d0' ParseDoDependency(.MAKEFLAGS: -d0) +make: "deptgt.mk" line 46: Unknown modifier 'Z' make: Fatal errors encountered -- cannot continue make: stopped in unit-tests exit status 1 diff --git a/usr.bin/make/unit-tests/deptgt.mk b/usr.bin/make/unit-tests/deptgt.mk index 83f81b6f58ed..09f381715e6d 100644 --- a/usr.bin/make/unit-tests/deptgt.mk +++ b/usr.bin/make/unit-tests/deptgt.mk @@ -1,4 +1,4 @@ -# $NetBSD: deptgt.mk,v 1.9 2020/11/15 11:57:00 rillig Exp $ +# $NetBSD: deptgt.mk,v 1.10 2020/12/27 18:20:26 rillig Exp $ # # Tests for special targets like .BEGIN or .SUFFIXES in dependency # declarations. @@ -37,5 +37,13 @@ ${:U}: empty-source : command for empty targets list .MAKEFLAGS: -d0 +# Just to show that a malformed expression is only expanded once in +# ParseDependencyTargetWord. The only way to produce an expression that +# is well-formed on the first expansion and ill-formed on the second +# expansion would be to use the variable modifier '::=' to modify the +# targets. This in turn would be such an extreme and unreliable edge case +# that nobody uses it. +$$$$$$$${:U:Z}: + all: @:;