Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use # min-llvm-version: 11.0 to force a minimum LLVM version #81688

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions src/test/run-make-fulldeps/coverage-llvmir/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# needs-profiler-support
# min-llvm-version: 11.0

-include ../coverage/coverage_tools.mk

Expand Down Expand Up @@ -48,12 +49,7 @@ else
-DINSTR_PROF_ORDERFILE='$(DATA_SECTION_PREFIX)__llvm_orderfile'
endif

ifeq ($(LLVM_VERSION_11_PLUS),true)
all: test_llvm_ir
else
$(info Rust option `-Z instrument-coverage` requires LLVM 11 or higher. Test skipped.)
all:
endif

test_llvm_ir:
# Compile the test program with non-experimental coverage instrumentation, and generate LLVM IR
Expand Down
6 changes: 1 addition & 5 deletions src/test/run-make-fulldeps/coverage-reports/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# needs-profiler-support
# ignore-windows-gnu
# min-llvm-version: 11.0

# FIXME(mati865): MinGW GCC miscompiles compiler-rt profiling library but with Clang it works
# properly. Since we only have GCC on the CI ignore the test for now.
Expand Down Expand Up @@ -67,12 +68,7 @@ ifdef RUSTC_BLESS_TEST
DEBUG_FLAG=--debug
endif

ifeq ($(LLVM_VERSION_11_PLUS),true)
all: $(patsubst $(SOURCEDIR)/lib/%.rs,%,$(wildcard $(SOURCEDIR)/lib/*.rs)) $(patsubst $(SOURCEDIR)/%.rs,%,$(wildcard $(SOURCEDIR)/*.rs))
else
$(info Rust option `-Z instrument-coverage` requires LLVM 11 or higher. Test skipped.)
all:
endif

# Ensure there are no `expected` results for tests that may have been removed or renamed
.PHONY: clear_expected_if_blessed
Expand Down
6 changes: 1 addition & 5 deletions src/test/run-make-fulldeps/coverage-spanview/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# needs-profiler-support
# min-llvm-version: 11.0

-include ../coverage/coverage_tools.mk

Expand All @@ -20,12 +21,7 @@ For revisions in Pull Requests (PR):
endef
export SPANVIEW_HEADER

ifeq ($(LLVM_VERSION_11_PLUS),true)
all: $(patsubst $(SOURCEDIR)/lib/%.rs,%,$(wildcard $(SOURCEDIR)/lib/*.rs)) $(patsubst $(SOURCEDIR)/%.rs,%,$(wildcard $(SOURCEDIR)/*.rs))
else
$(info Rust option `-Z instrument-coverage` requires LLVM 11 or higher. Test skipped.)
all:
endif

# Ensure there are no `expected` results for tests that may have been removed or renamed
.PHONY: clear_expected_if_blessed
Expand Down
7 changes: 0 additions & 7 deletions src/test/run-make-fulldeps/coverage/coverage_tools.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,3 @@
# Therefore, `-C link-dead-code` is no longer automatically enabled.

UNAME = $(shell uname)

# Rust option `-Z instrument-coverage` uses LLVM Coverage Mapping Format version 4,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Presumably this file is not adding much value anymore and we should move the uname to tools.mk?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah but lets maybe leave that for a later PR. Or at least, this may need to be backported when I add the other beta backports that depend on it (maybe)?

Copy link
Member Author

@pnkfelix pnkfelix Feb 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm on second thought I guess the backport of this PR isn't actually necessary since all it will mean is that the tests on beta will continue to be incorrectly ignored

# which requires LLVM 11 or greater.
LLVM_VERSION_11_PLUS := $(shell \
LLVM_VERSION=$$("$(LLVM_BIN_DIR)"/llvm-config --version) && \
LLVM_VERSION_MAJOR=$${LLVM_VERSION/.*/} && \
[ $$LLVM_VERSION_MAJOR -ge 11 ] && echo true || echo false)