diff options
Diffstat (limited to 'contrib/bmake/unit-tests/cond-op-or.mk')
-rw-r--r-- | contrib/bmake/unit-tests/cond-op-or.mk | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/contrib/bmake/unit-tests/cond-op-or.mk b/contrib/bmake/unit-tests/cond-op-or.mk index 696b9dd23062..c6993e7c277e 100644 --- a/contrib/bmake/unit-tests/cond-op-or.mk +++ b/contrib/bmake/unit-tests/cond-op-or.mk @@ -1,21 +1,21 @@ -# $NetBSD: cond-op-or.mk,v 1.3 2020/08/28 14:48:37 rillig Exp $ +# $NetBSD: cond-op-or.mk,v 1.6 2020/10/24 08:46:08 rillig Exp $ # # Tests for the || operator in .if conditions. .if 0 || 0 -.error +. error .endif .if !(1 || 0) -.error +. error .endif .if !(0 || 1) -.error +. error .endif .if !(1 || 1) -.error +. error .endif # The right-hand side is not evaluated since the left-hand side is already @@ -23,5 +23,26 @@ .if 1 || ${UNDEF} .endif +# The || operator may be abbreviated as |. This is not widely known though +# and is also not documented in the manual page. + +.if 0 | 0 +. error +.endif +.if !(1 | 0) +. error +.endif +.if !(0 | 1) +. error +.endif +.if !(1 | 1) +. error +.endif + +# There is no operator |||. +.if 0 ||| 0 +. error +.endif + all: @:; |