xref: /freebsd/contrib/bmake/unit-tests/cond-func-defined.mk (revision fe815331bb40604ba31312acf7e4619674631777)
1# $NetBSD: cond-func-defined.mk,v 1.3 2020/08/20 17:23:43 rillig Exp $
2#
3# Tests for the defined() function in .if conditions.
4
5DEF=		defined
6${:UA B}=	variable name with spaces
7
8.if !defined(DEF)
9.error
10.endif
11
12# Horizontal whitespace after the opening parenthesis is ignored.
13.if !defined( 	DEF)
14.error
15.endif
16
17# Horizontal whitespace 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
32all:
33	@:;
34