diff options
Diffstat (limited to 'unit-tests/cond-func-defined.mk')
-rw-r--r-- | unit-tests/cond-func-defined.mk | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/unit-tests/cond-func-defined.mk b/unit-tests/cond-func-defined.mk index ec4feae05839..2aa49ccbf147 100644 --- a/unit-tests/cond-func-defined.mk +++ b/unit-tests/cond-func-defined.mk @@ -1,4 +1,4 @@ -# $NetBSD: cond-func-defined.mk,v 1.5 2020/10/24 08:46:08 rillig Exp $ +# $NetBSD: cond-func-defined.mk,v 1.7 2020/11/15 14:07:53 rillig Exp $ # # Tests for the defined() function in .if conditions. @@ -29,5 +29,24 @@ ${:UA B}= variable name with spaces . error .endif +# Parse error: missing closing parenthesis; see ParseFuncArg. +.if defined(DEF +. error +.else +. error +.endif + +# Variables from .for loops are not defined. +# See directive-for.mk for more details. +.for var in value +. if defined(var) +. error +. else +. info In .for loops, variable expressions for the loop variables are +. info substituted at evaluation time. There is no actual variable +. info involved, even if it feels like it. +. endif +.endfor + all: @:; |