aboutsummaryrefslogtreecommitdiff
path: root/contrib/bmake/unit-tests/cond-func-exists.mk
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/bmake/unit-tests/cond-func-exists.mk')
-rw-r--r--contrib/bmake/unit-tests/cond-func-exists.mk11
1 files changed, 8 insertions, 3 deletions
diff --git a/contrib/bmake/unit-tests/cond-func-exists.mk b/contrib/bmake/unit-tests/cond-func-exists.mk
index 48d7e727dc3f..c68507ca1ab9 100644
--- a/contrib/bmake/unit-tests/cond-func-exists.mk
+++ b/contrib/bmake/unit-tests/cond-func-exists.mk
@@ -1,4 +1,4 @@
-# $NetBSD: cond-func-exists.mk,v 1.6 2020/11/30 20:12:29 rillig Exp $
+# $NetBSD: cond-func-exists.mk,v 1.8 2025/01/10 23:00:38 rillig Exp $
#
# Tests for the exists() function in .if conditions.
@@ -17,7 +17,7 @@
.endif
# The only way to escape characters that would otherwise influence the parser
-# is to enclose them in a variable expression. For function arguments,
+# is to enclose them in an expression. For function arguments,
# neither the backslash nor the dollar sign act as escape character.
.if exists(\.)
. error
@@ -27,7 +27,7 @@
. error
.endif
-# The argument to the function can have several variable expressions.
+# The argument to the function can have several expressions.
# See cond-func.mk for the characters that cannot be used directly.
.if !exists(${.PARSEDIR}/${.PARSEFILE})
. error
@@ -38,6 +38,11 @@
. error
.endif
+# Expressions in the argument of a function call don't have to be defined.
+.if exists(${UNDEF})
+. error
+.endif
+
# The exists function does not really look up the file in the file system,
# instead it uses a cache that is preloaded very early, before parsing the
# first makefile. At that time, the file did not exist yet.