Skip to content

Commit

Permalink
Make run-make PGO tests work on MSVC.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelwoerister committed May 29, 2019
1 parent ebabcf7 commit a19a9e9
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 4 deletions.
12 changes: 11 additions & 1 deletion src/test/run-make-fulldeps/pgo-gen-lto/Makefile
Expand Up @@ -2,7 +2,17 @@

-include ../tools.mk

COMPILE_FLAGS=-Copt-level=3 -Clto=fat -Z pgo-gen="$(TMPDIR)"

# LLVM doesn't yet support instrumenting binaries that use unwinding on MSVC:
# https://github.com/rust-lang/rust/issues/61002
#
# Things work fine with -Cpanic=abort though.
ifdef IS_MSVC
COMPILE_FLAGS+= -Cpanic=abort
endif

all:
$(RUSTC) -Copt-level=3 -Clto=fat -Z pgo-gen="$(TMPDIR)" test.rs
$(RUSTC) $(COMPILE_FLAGS) test.rs
$(call RUN,test) || exit 1
[ -e "$(TMPDIR)"/default_*.profraw ] || (echo "No .profraw file"; exit 1)
12 changes: 11 additions & 1 deletion src/test/run-make-fulldeps/pgo-gen-no-imp-symbols/Makefile
Expand Up @@ -2,8 +2,18 @@

-include ../tools.mk

COMPILE_FLAGS=-O -Ccodegen-units=1 -Z pgo-gen="$(TMPDIR)"

# LLVM doesn't yet support instrumenting binaries that use unwinding on MSVC:
# https://github.com/rust-lang/rust/issues/61002
#
# Things work fine with -Cpanic=abort though.
ifdef IS_MSVC
COMPILE_FLAGS+= -Cpanic=abort
endif

all:
$(RUSTC) -O -Ccodegen-units=1 -Z pgo-gen="$(TMPDIR)" --emit=llvm-ir test.rs
$(RUSTC) $(COMPILE_FLAGS) --emit=llvm-ir test.rs
# We expect symbols starting with "__llvm_profile_".
$(CGREP) "__llvm_profile_" < $(TMPDIR)/test.ll
# We do NOT expect the "__imp_" version of these symbols.
Expand Down
12 changes: 11 additions & 1 deletion src/test/run-make-fulldeps/pgo-gen/Makefile
Expand Up @@ -2,7 +2,17 @@

-include ../tools.mk

COMPILE_FLAGS=-g -Z pgo-gen="$(TMPDIR)"

# LLVM doesn't yet support instrumenting binaries that use unwinding on MSVC:
# https://github.com/rust-lang/rust/issues/61002
#
# Things work fine with -Cpanic=abort though.
ifdef IS_MSVC
COMPILE_FLAGS+= -Cpanic=abort
endif

all:
$(RUSTC) -g -Z pgo-gen="$(TMPDIR)" test.rs
$(RUSTC) $(COMPILE_FLAGS) test.rs
$(call RUN,test) || exit 1
[ -e "$(TMPDIR)"/default_*.profraw ] || (echo "No .profraw file"; exit 1)
2 changes: 1 addition & 1 deletion src/test/run-make-fulldeps/pgo-use/Makefile
Expand Up @@ -16,7 +16,7 @@
COMMON_FLAGS=-Copt-level=s -Ccodegen-units=1

# LLVM doesn't support instrumenting binaries that use SEH:
# https://bugs.llvm.org/show_bug.cgi?id=41279
# https://github.com/rust-lang/rust/issues/61002
#
# Things work fine with -Cpanic=abort though.
ifdef IS_MSVC
Expand Down

0 comments on commit a19a9e9

Please sign in to comment.