]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/bmake/unit-tests/cond-func-defined.mk
Update to bmake-20201101
[FreeBSD/FreeBSD.git] / contrib / bmake / unit-tests / cond-func-defined.mk
1 # $NetBSD: cond-func-defined.mk,v 1.5 2020/10/24 08:46:08 rillig Exp $
2 #
3 # Tests for the defined() function in .if conditions.
4
5 DEF=            defined
6 ${:UA B}=       variable name with spaces
7
8 .if !defined(DEF)
9 .  error
10 .endif
11
12 # Horizontal whitespace (space tab) after the opening parenthesis is ignored.
13 .if !defined(   DEF)
14 .  error
15 .endif
16
17 # Horizontal whitespace (space tab) before the closing parenthesis is ignored.
18 .if !defined(DEF        )
19 .  error
20 .endif
21
22 # The argument of a function must not directly contain whitespace.
23 .if !defined(A B)
24 .  error
25 .endif
26
27 # If necessary, the whitespace can be generated by a variable expression.
28 .if !defined(${:UA B})
29 .  error
30 .endif
31
32 all:
33         @:;