aboutsummaryrefslogtreecommitdiff
path: root/contrib/bmake/unit-tests/directive-elifndef.mk
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/bmake/unit-tests/directive-elifndef.mk')
-rw-r--r--contrib/bmake/unit-tests/directive-elifndef.mk23
1 files changed, 19 insertions, 4 deletions
diff --git a/contrib/bmake/unit-tests/directive-elifndef.mk b/contrib/bmake/unit-tests/directive-elifndef.mk
index 19bb66c11b01..87aaf2fdd9ac 100644
--- a/contrib/bmake/unit-tests/directive-elifndef.mk
+++ b/contrib/bmake/unit-tests/directive-elifndef.mk
@@ -1,8 +1,23 @@
-# $NetBSD: directive-elifndef.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $
+# $NetBSD: directive-elifndef.mk,v 1.3 2022/01/22 21:50:41 rillig Exp $
#
-# Tests for the .elifndef directive.
+# Tests for the .elifndef directive, which is an obscure form of writing the
+# more usual '.elif !defined(VAR)'.
-# TODO: Implementation
+# At this point, VAR is not yet defined, and due to the 'n' in 'elifndef' the
+# condition evaluates to true.
+.if 0
+.elifndef VAR && VAR || VAR
+.else
+. error
+.endif
+
+VAR= # defined
+
+# At this point, VAR is defined, and due to the 'n' in 'elifndef' the
+# condition evaluates to false.
+.if 0
+.elifndef VAR && VAR || VAR
+. error
+.endif
all:
- @:;