diff options
Diffstat (limited to 'unit-tests/directive-ifdef.mk')
-rw-r--r-- | unit-tests/directive-ifdef.mk | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/unit-tests/directive-ifdef.mk b/unit-tests/directive-ifdef.mk index 516e095c464f..12f3648e8b2c 100644 --- a/unit-tests/directive-ifdef.mk +++ b/unit-tests/directive-ifdef.mk @@ -1,4 +1,4 @@ -# $NetBSD: directive-ifdef.mk,v 1.3 2020/11/08 22:38:28 rillig Exp $ +# $NetBSD: directive-ifdef.mk,v 1.4 2021/01/21 23:03:41 rillig Exp $ # # Tests for the .ifdef directive. @@ -14,5 +14,20 @@ DEFINED= defined . error .endif +# String literals are handled the same in all variants of the .if directive. +# They evaluate to true if they are not empty. Whitespace counts as non-empty +# as well. +.ifdef "" +. error +.else +. info String literals are tested for emptiness. +.endif + +.ifdef " " +. info String literals are tested for emptiness. Whitespace is non-empty. +.else +. error +.endif + all: @:; |