1 # needs-profiler-support
5 COMPILE_FLAGS=-O -Ccodegen-units=1 -Cprofile-generate="$(TMPDIR)"
7 # LLVM doesn't yet support instrumenting binaries that use unwinding on MSVC:
8 # https://github.com/rust-lang/rust/issues/61002
10 # Things work fine with -Cpanic=abort though.
12 COMPILE_FLAGS+= -Cpanic=abort
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