Module Name: src Committed By: rillig Date: Sun Jul 26 11:19:04 UTC 2020
Modified Files: src/usr.bin/make/unit-tests: sysv.exp sysv.mk Log Message: make(1): add test for prefix mismatch in SysV substitution To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/usr.bin/make/unit-tests/sysv.exp \ src/usr.bin/make/unit-tests/sysv.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.bin/make/unit-tests/sysv.exp diff -u src/usr.bin/make/unit-tests/sysv.exp:1.8 src/usr.bin/make/unit-tests/sysv.exp:1.9 --- src/usr.bin/make/unit-tests/sysv.exp:1.8 Mon Jul 20 16:32:14 2020 +++ src/usr.bin/make/unit-tests/sysv.exp Sun Jul 26 11:19:04 2020 @@ -17,4 +17,6 @@ bcd.e & anchor-dollar: value anchor-dollar: valux +mismatch: file.cpp file.h +mismatch: renamed.c other.c exit status 0 Index: src/usr.bin/make/unit-tests/sysv.mk diff -u src/usr.bin/make/unit-tests/sysv.mk:1.8 src/usr.bin/make/unit-tests/sysv.mk:1.9 --- src/usr.bin/make/unit-tests/sysv.mk:1.8 Mon Jul 20 16:27:55 2020 +++ src/usr.bin/make/unit-tests/sysv.mk Sun Jul 26 11:19:04 2020 @@ -1,6 +1,7 @@ -# $Id: sysv.mk,v 1.8 2020/07/20 16:27:55 rillig Exp $ +# $Id: sysv.mk,v 1.9 2020/07/26 11:19:04 rillig Exp $ all: foo fun sam bla words ampersand anchor-dollar +all: mismatch FOO ?= FOOBAR = ${FOO:=bar} @@ -61,3 +62,9 @@ ampersand: anchor-dollar: @echo $@: ${:U${value:L:e$=x}:Q} @echo $@: ${:U${value:L:e=x}:Q} + +# Words that don't match are copied unmodified. +# The % placeholder can be anywhere in the string. +mismatch: + @echo $@: ${:Ufile.c file.h:%.c=%.cpp} + @echo $@: ${:Ufile.c other.c:file.%=renamed.%}