Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/make/unit-tests make(1): add test for dynamic variab...
details: https://anonhg.NetBSD.org/src/rev/90be24f9094e
branches: trunk
changeset: 1016453:90be24f9094e
user: rillig <rillig%NetBSD.org@localhost>
date: Sat Nov 21 15:48:05 2020 +0000
description:
make(1): add test for dynamic variable with modifiers in global context
diffstat:
usr.bin/make/unit-tests/varparse-dynamic.mk | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
diffs (25 lines):
diff -r c9cbb437fb95 -r 90be24f9094e usr.bin/make/unit-tests/varparse-dynamic.mk
--- a/usr.bin/make/unit-tests/varparse-dynamic.mk Sat Nov 21 15:36:36 2020 +0000
+++ b/usr.bin/make/unit-tests/varparse-dynamic.mk Sat Nov 21 15:48:05 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: varparse-dynamic.mk,v 1.2 2020/09/13 21:00:34 rillig Exp $
+# $NetBSD: varparse-dynamic.mk,v 1.3 2020/11/21 15:48:05 rillig Exp $
# Before 2020-07-27, there was an off-by-one error in Var_Parse that skipped
# the last character in the variable name.
@@ -21,5 +21,15 @@
. error
.endif
+# If a dynamic variable is expanded in a non-local context, the expression
+# based on this variable is not expanded. But there may be nested variable
+# expressions in the modifiers, and these are kept unexpanded as well.
+.if ${.TARGET:M${:Ufallback}} != "\${.TARGET:M\${:Ufallback}}"
+. error
+.endif
+.if ${.TARGET:M${UNDEF}} != "\${.TARGET:M\${UNDEF}}"
+. error
+.endif
+
all:
@:
Home |
Main Index |
Thread Index |
Old Index