]> git.lizzy.rs Git - rust.git/blob - src/test/run-make/pretty-expanded-hygiene/Makefile
rollup merge of #20642: michaelwoerister/sane-source-locations-pt1
[rust.git] / src / test / run-make / pretty-expanded-hygiene / Makefile
1 -include ../tools.mk
2
3 REPLACEMENT := s/[0-9][0-9]*\#[0-9][0-9]*/$(shell date)/g
4
5 all:
6         $(RUSTC) -o $(TMPDIR)/input.out -Z unstable-options \
7                 --pretty expanded,hygiene input.rs
8
9         # the name/ctxt numbers are very internals-dependent and thus
10         # change relatively frequently, and testing for their exact values
11         # them will fail annoyingly, so we just check their positions
12         # (using a non-constant replacement like this will make it less
13         # likely the compiler matches whatever other dummy value we
14         # choose).
15         #
16         # (These need to be out-of-place because OSX/BSD & GNU sed
17         # differ.)
18         sed "$(REPLACEMENT)" input.pp.rs > $(TMPDIR)/input.pp.rs
19         sed "$(REPLACEMENT)" $(TMPDIR)/input.out > $(TMPDIR)/input.out.replaced
20
21         diff -u $(TMPDIR)/input.out.replaced $(TMPDIR)/input.pp.rs