1# $NetBSD: opt-debug-parse.mk,v 1.8 2023/06/01 20:56:35 rillig Exp $
2#
3# Tests for the -dp command line option, which adds debug logging about
4# makefile parsing.
5
6.MAKEFLAGS: -dp
7
8# TODO: Implementation
9
10# Before parse.c 1.639 from 2022-01-08, PrintStackTrace and other diagnostics
11# printed a wrong line number, using the last line before the loop body, while
12# it should rather be the line number where the .for loop starts.
13#
14# Before parse.c 1.643 from 2022-01-08, PrintStackTrace tried to be too clever
15# by merging stack trace entries, printing confusing line numbers as a result.
16.for \
17    var \
18    in \
19    value
20# expect+1: trace with multi-line .for loop head
21.info trace with multi-line .for loop head
22.endfor
23
24# Before parse.c 1.641 from 2022-01-08, the debug log said it returned to
25# the line of the '.include' instead of the line following it.
26.include "/dev/null"
27
28
29# In .for loops with multiple variables, the variable details are included in
30# the stack trace, just as with a single variable.
31.for a b c in 1 2 3 ${:U4 5 6}
32# expect+2: trace
33# expect+1: trace
34.info trace
35.endfor
36
37
38.MAKEFLAGS: -d0
39
40all: .PHONY
41