summaryrefslogtreecommitdiff
path: root/unit-tests/cond-func-defined.mk
diff options
context:
space:
mode:
Diffstat (limited to 'unit-tests/cond-func-defined.mk')
-rw-r--r--unit-tests/cond-func-defined.mk11
1 files changed, 8 insertions, 3 deletions
diff --git a/unit-tests/cond-func-defined.mk b/unit-tests/cond-func-defined.mk
index 6b24182c11c1..66f95f3380c1 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.12 2024/04/23 22:51:28 rillig Exp $
+# $NetBSD: cond-func-defined.mk,v 1.14 2025/01/10 23:00:38 rillig Exp $
#
# Tests for the defined() function in .if conditions.
@@ -20,7 +20,7 @@ ${:UA B}= variable name with spaces
.endif
# The argument of a function must not directly contain whitespace.
-# expect+1: Missing closing parenthesis for defined()
+# expect+1: Missing ')' after argument 'A' for 'defined'
.if !defined(A B)
. error
.endif
@@ -30,7 +30,7 @@ ${:UA B}= variable name with spaces
. error
.endif
-# expect+1: Missing closing parenthesis for defined()
+# expect+1: Missing ')' after argument 'DEF' for 'defined'
.if defined(DEF
. error
.else
@@ -49,6 +49,11 @@ ${:UA B}= variable name with spaces
. endif
.endfor
+# Expressions in the argument of a function call don't have to be defined.
+.if defined(${UNDEF})
+. error
+.endif
+
# Neither of the conditions is true. Before July 2020, the right-hand
# condition was evaluated even though it was irrelevant.
.if defined(UNDEF) && ${UNDEF:Mx} != ""