Skip to content

Commit 34d3fcb

Browse files
committed
Add test of --print + -o
1 parent 7bd81ee commit 34d3fcb

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tests/run-make/print-cfg/Makefile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
include ../tools.mk
44

5-
all: default
5+
all: default output_to_file
66
$(RUSTC) --target x86_64-pc-windows-gnu --print cfg | $(CGREP) windows
77
$(RUSTC) --target x86_64-pc-windows-gnu --print cfg | $(CGREP) x86_64
88
$(RUSTC) --target i686-pc-windows-msvc --print cfg | $(CGREP) msvc
@@ -11,6 +11,14 @@ all: default
1111
$(RUSTC) --target arm-unknown-linux-gnueabihf --print cfg | $(CGREP) target_abi=
1212
$(RUSTC) --target arm-unknown-linux-gnueabihf --print cfg | $(CGREP) eabihf
1313

14+
output_to_file:
15+
-rm $(TMPDIR)/cfg.txt
16+
$(RUSTC) --target x86_64-pc-windows-gnu --print=cfg -o $(TMPDIR)/cfg.txt
17+
$(CGREP) windows < $(TMPDIR)/cfg.txt
18+
-rm $(TMPDIR)/cfg.txt
19+
$(RUSTC) --target x86_64-pc-windows-gnu --print=target-cpus -o $(TMPDIR)/cfg.txt
20+
$(CGREP) native < $(TMPDIR)/cfg.txt
21+
1422
ifdef IS_WINDOWS
1523
default:
1624
$(RUSTC) --print cfg | $(CGREP) windows

0 commit comments

Comments
 (0)