fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
1.1 KiB27 linesraw
1# needs-profiler-support
2# ignore-windows-gnu
3# ignore-cross-compile
4
5# FIXME(mati865): MinGW GCC miscompiles compiler-rt profiling library but with Clang it works
6# properly. Since we only have GCC on the CI ignore the test for now.
7
8include ../tools.mk
9
10all:
11	# We don't compile `opaque` with either optimizations or instrumentation.
12	# We don't compile `opaque` with either optimizations or instrumentation.
13	$(RUSTC) $(COMMON_FLAGS) opaque.rs
14	# Compile the test program with instrumentation
15	mkdir -p "$(TMPDIR)"/prof_data_dir
16	$(RUSTC) $(COMMON_FLAGS) interesting.rs \
17		-Cprofile-generate="$(TMPDIR)"/prof_data_dir -O -Ccodegen-units=1
18	$(RUSTC) $(COMMON_FLAGS) main.rs -Cprofile-generate="$(TMPDIR)"/prof_data_dir -O
19	# The argument below generates to the expected branch weights
20	$(call RUN,main) || exit 1
21	"$(LLVM_BIN_DIR)"/llvm-profdata merge \
22		-o "$(TMPDIR)"/prof_data_dir/merged.profdata \
23		"$(TMPDIR)"/prof_data_dir
24	$(RUSTC) $(COMMON_FLAGS) interesting.rs \
25		-Cprofile-use="$(TMPDIR)"/prof_data_dir/merged.profdata -O \
26		-Ccodegen-units=1 --emit=llvm-ir
27	cat "$(TMPDIR)"/interesting.ll | "$(LLVM_FILECHECK)" filecheck-patterns.txt