about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Woerister <michaelwoerister@posteo>2019-05-29 14:32:38 +0200
committerMichael Woerister <michaelwoerister@posteo>2019-05-29 14:32:38 +0200
commita19a9e9194a03add87cd10aacfe518a61487cf0d (patch)
treed2ece37c149dafb4f44971782daf9dbdfe73aeed
parentebabcf710515fb2b24907cf90fe02410ad675829 (diff)
downloadrust-a19a9e9194a03add87cd10aacfe518a61487cf0d.tar.gz
rust-a19a9e9194a03add87cd10aacfe518a61487cf0d.zip
Make run-make PGO tests work on MSVC.
-rw-r--r--src/test/run-make-fulldeps/pgo-gen-lto/Makefile12
-rw-r--r--src/test/run-make-fulldeps/pgo-gen-no-imp-symbols/Makefile12
-rw-r--r--src/test/run-make-fulldeps/pgo-gen/Makefile12
-rw-r--r--src/test/run-make-fulldeps/pgo-use/Makefile2
4 files changed, 34 insertions, 4 deletions
diff --git a/src/test/run-make-fulldeps/pgo-gen-lto/Makefile b/src/test/run-make-fulldeps/pgo-gen-lto/Makefile
index 48181bcbdc6..56f31434ade 100644
--- a/src/test/run-make-fulldeps/pgo-gen-lto/Makefile
+++ b/src/test/run-make-fulldeps/pgo-gen-lto/Makefile
@@ -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)
diff --git a/src/test/run-make-fulldeps/pgo-gen-no-imp-symbols/Makefile b/src/test/run-make-fulldeps/pgo-gen-no-imp-symbols/Makefile
index 20977edb88e..bb86160d2df 100644
--- a/src/test/run-make-fulldeps/pgo-gen-no-imp-symbols/Makefile
+++ b/src/test/run-make-fulldeps/pgo-gen-no-imp-symbols/Makefile
@@ -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.
diff --git a/src/test/run-make-fulldeps/pgo-gen/Makefile b/src/test/run-make-fulldeps/pgo-gen/Makefile
index ce44c10a7c2..f0ab3b7d13d 100644
--- a/src/test/run-make-fulldeps/pgo-gen/Makefile
+++ b/src/test/run-make-fulldeps/pgo-gen/Makefile
@@ -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)
diff --git a/src/test/run-make-fulldeps/pgo-use/Makefile b/src/test/run-make-fulldeps/pgo-use/Makefile
index ababd45d33e..72c3c34ee37 100644
--- a/src/test/run-make-fulldeps/pgo-use/Makefile
+++ b/src/test/run-make-fulldeps/pgo-use/Makefile
@@ -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