diff options
Diffstat (limited to 'contrib/bmake/unit-tests/varparse-dynamic.mk')
-rw-r--r-- | contrib/bmake/unit-tests/varparse-dynamic.mk | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/contrib/bmake/unit-tests/varparse-dynamic.mk b/contrib/bmake/unit-tests/varparse-dynamic.mk index 228eb17475b0..29051d31eeea 100644 --- a/contrib/bmake/unit-tests/varparse-dynamic.mk +++ b/contrib/bmake/unit-tests/varparse-dynamic.mk @@ -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: @: |