fork/rust

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

borsAuto merge of #67350 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum73528e339aa

1.40.0
690 B21 linesraw
1# needs-profiler-support
2
3-include ../tools.mk
4
5COMPILE_FLAGS=-O -Ccodegen-units=1 -Cprofile-generate="$(TMPDIR)"
6
7# LLVM doesn't yet support instrumenting binaries that use unwinding on MSVC:
8# https://github.com/rust-lang/rust/issues/61002
9#
10# Things work fine with -Cpanic=abort though.
11ifdef IS_MSVC
12COMPILE_FLAGS+= -Cpanic=abort
13endif
14
15all:
16	$(RUSTC) $(COMPILE_FLAGS) --emit=llvm-ir test.rs
17	# We expect symbols starting with "__llvm_profile_".
18	$(CGREP) "__llvm_profile_" < $(TMPDIR)/test.ll
19	# We do NOT expect the "__imp_" version of these symbols.
20	$(CGREP) -v "__imp___llvm_profile_" < $(TMPDIR)/test.ll # 64 bit
21	$(CGREP) -v "__imp____llvm_profile_" < $(TMPDIR)/test.ll # 32 bit