]> git.lizzy.rs Git - rust.git/blob - tests/run-make/track-pgo-dep-info/Makefile
Rollup merge of #106715 - BoxyUwU:new_solver_triagebot, r=lcnr
[rust.git] / tests / run-make / track-pgo-dep-info / Makefile
1 # needs-profiler-support
2 # ignore-windows-gnu
3
4 -include ../../run-make-fulldeps/tools.mk
5
6 # FIXME(eddyb) provide `HOST_RUSTC` and `TARGET_RUSTC`
7 # instead of hardcoding them everywhere they're needed.
8 ifeq ($(IS_MUSL_HOST),1)
9 ADDITIONAL_ARGS := $(RUSTFLAGS)
10 endif
11
12 all:
13         # Generate PGO profiles
14         $(BARE_RUSTC) $(ADDITIONAL_ARGS) -Cprofile-generate=$(TMPDIR)/profiles --out-dir $(TMPDIR) main.rs
15         $(TMPDIR)/main
16
17         # Merge profiles
18         "$(LLVM_BIN_DIR)/llvm-profdata" merge \
19                 -o "$(TMPDIR)/merged.profdata" \
20                 "$(TMPDIR)/profiles" || exit 1
21
22         # Use the profile
23         $(RUSTC) -Cprofile-use=$(TMPDIR)/merged.profdata --emit dep-info main.rs
24
25         # Check that profile file is in depinfo
26         $(CGREP) "merged.profdata" < $(TMPDIR)/main.d