Skip to content

Commit 85a98b0

Browse files
committed
Add test of --print KIND=PATH
1 parent 299179e commit 85a98b0

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

tests/run-make/print-cfg/Makefile

Lines changed: 18 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,23 @@ 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+
# Backend-independent, printed by rustc_driver_impl/src/lib.rs
16+
$(RUSTC) --target x86_64-pc-windows-gnu --print cfg=$(TMPDIR)/cfg.txt
17+
$(CGREP) windows < $(TMPDIR)/cfg.txt
18+
19+
# Printed from CodegenBackend trait impl in rustc_codegen_llvm/src/lib.rs
20+
$(RUSTC) --print relocation-models=$(TMPDIR)/relocation-models.txt
21+
$(CGREP) dynamic-no-pic < $(TMPDIR)/relocation-models.txt
22+
23+
# Printed by compiler/rustc_codegen_llvm/src/llvm_util.rs
24+
$(RUSTC) --target wasm32-unknown-unknown --print target-features=$(TMPDIR)/target-features.txt
25+
$(CGREP) reference-types < $(TMPDIR)/target-features.txt
26+
27+
# Printed by C++ code in rustc_llvm/llvm-wrapper/PassWrapper.cpp
28+
$(RUSTC) --target x86_64-pc-windows-gnu --print target-cpus=$(TMPDIR)/target-cpus.txt
29+
$(CGREP) native < $(TMPDIR)/target-cpus.txt
30+
1431
ifdef IS_WINDOWS
1532
default:
1633
$(RUSTC) --print cfg | $(CGREP) windows

0 commit comments

Comments
 (0)