Skip to content

Commit a19a9e9

Browse files
Make run-make PGO tests work on MSVC.
1 parent ebabcf7 commit a19a9e9

File tree

4 files changed

+34
-4
lines changed

4 files changed

+34
-4
lines changed

src/test/run-make-fulldeps/pgo-gen-lto/Makefile

+11-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,17 @@
22

33
-include ../tools.mk
44

5+
COMPILE_FLAGS=-Copt-level=3 -Clto=fat -Z pgo-gen="$(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.
11+
ifdef IS_MSVC
12+
COMPILE_FLAGS+= -Cpanic=abort
13+
endif
14+
515
all:
6-
$(RUSTC) -Copt-level=3 -Clto=fat -Z pgo-gen="$(TMPDIR)" test.rs
16+
$(RUSTC) $(COMPILE_FLAGS) test.rs
717
$(call RUN,test) || exit 1
818
[ -e "$(TMPDIR)"/default_*.profraw ] || (echo "No .profraw file"; exit 1)

src/test/run-make-fulldeps/pgo-gen-no-imp-symbols/Makefile

+11-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,18 @@
22

33
-include ../tools.mk
44

5+
COMPILE_FLAGS=-O -Ccodegen-units=1 -Z pgo-gen="$(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.
11+
ifdef IS_MSVC
12+
COMPILE_FLAGS+= -Cpanic=abort
13+
endif
14+
515
all:
6-
$(RUSTC) -O -Ccodegen-units=1 -Z pgo-gen="$(TMPDIR)" --emit=llvm-ir test.rs
16+
$(RUSTC) $(COMPILE_FLAGS) --emit=llvm-ir test.rs
717
# We expect symbols starting with "__llvm_profile_".
818
$(CGREP) "__llvm_profile_" < $(TMPDIR)/test.ll
919
# We do NOT expect the "__imp_" version of these symbols.

src/test/run-make-fulldeps/pgo-gen/Makefile

+11-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,17 @@
22

33
-include ../tools.mk
44

5+
COMPILE_FLAGS=-g -Z pgo-gen="$(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.
11+
ifdef IS_MSVC
12+
COMPILE_FLAGS+= -Cpanic=abort
13+
endif
14+
515
all:
6-
$(RUSTC) -g -Z pgo-gen="$(TMPDIR)" test.rs
16+
$(RUSTC) $(COMPILE_FLAGS) test.rs
717
$(call RUN,test) || exit 1
818
[ -e "$(TMPDIR)"/default_*.profraw ] || (echo "No .profraw file"; exit 1)

src/test/run-make-fulldeps/pgo-use/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
COMMON_FLAGS=-Copt-level=s -Ccodegen-units=1
1717

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

0 commit comments

Comments
 (0)