Skip to content

Commit a84f754

Browse files
committed
Use -Zno-profiler-runtime instead of //@ needs-profiler-support
For PGO/coverage tests that don't need to build or run an actual artifact, we can use `-Zno-profiler-runtime` to run the test even when the profiler runtime is not available.
1 parent f6b4b71 commit a84f754

File tree

9 files changed

+9
-11
lines changed

9 files changed

+9
-11
lines changed

tests/codegen/instrument-coverage/instrument-coverage-off.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Test that `-Cinstrument-coverage=off` does not add coverage instrumentation to LLVM IR.
22

3+
//@ compile-flags: -Zno-profiler-runtime
34
//@ revisions: n no off false_ zero
45
//@ [n] compile-flags: -Cinstrument-coverage=n
56
//@ [no] compile-flags: -Cinstrument-coverage=no

tests/codegen/instrument-coverage/instrument-coverage.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Test that `-Cinstrument-coverage` creates expected __llvm_profile_filename symbol in LLVM IR.
22

3-
//@ needs-profiler-support
3+
//@ compile-flags: -Zno-profiler-runtime
44
//@ revisions: default y yes on true_ all
55
//@ [default] compile-flags: -Cinstrument-coverage
66
//@ [y] compile-flags: -Cinstrument-coverage=y

tests/codegen/instrument-coverage/testprog.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@ edition: 2021
2-
//@ needs-profiler-support
2+
//@ compile-flags: -Zno-profiler-runtime
33
//@ compile-flags: -Cinstrument-coverage -Copt-level=0
44
//@ revisions: LINUX DARWIN WINDOWS
55

tests/codegen/naked-fn/naked-nocoverage.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Regression test for issue #105170.
33
//
44
//@ needs-asm-support
5-
//@ needs-profiler-support
5+
//@ compile-flags: -Zno-profiler-runtime
66
//@ compile-flags: -Cinstrument-coverage
77
#![crate_type = "lib"]
88
#![feature(naked_functions)]

tests/codegen/pgo-counter-bias.rs

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

33
//@ ignore-apple -runtime-counter-relocation not honored on Mach-O
44
//@ compile-flags: -Cprofile-generate -Cllvm-args=-runtime-counter-relocation -Clto=fat
5-
//@ needs-profiler-support
5+
//@ compile-flags: -Zno-profiler-runtime
66
//@ no-prefer-dynamic
77

88
// CHECK: @__llvm_profile_counter_bias = {{.*}}global

tests/codegen/pgo-instrumentation.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Test that `-Cprofile-generate` creates expected instrumentation artifacts in LLVM IR.
22

3-
//@ needs-profiler-support
3+
//@ compile-flags: -Zno-profiler-runtime
44
//@ compile-flags: -Cprofile-generate -Ccodegen-units=1
55

66
// CHECK: @__llvm_profile_raw_version =

tests/run-make/pgo-gen-no-imp-symbols/Makefile

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
# needs-profiler-support
2-
31
include ../tools.mk
42

5-
COMPILE_FLAGS=-O -Ccodegen-units=1 -Cprofile-generate="$(TMPDIR)"
3+
COMPILE_FLAGS=-O -Ccodegen-units=1 -Cprofile-generate="$(TMPDIR)" -Zno-profiler-runtime
64

75
all:
86
$(RUSTC) $(COMPILE_FLAGS) --emit=llvm-ir test.rs

tests/ui/instrument-coverage/coverage-options.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
//@ needs-profiler-support
21
//@ revisions: block branch condition mcdc bad
3-
//@ compile-flags -Cinstrument-coverage
2+
//@ compile-flags -Cinstrument-coverage -Zno-profiler-runtime
43

54
//@ [block] check-pass
65
//@ [block] compile-flags: -Zcoverage-options=block

tests/ui/instrument-coverage/on-values.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@ check-pass
2-
//@ needs-profiler-support
2+
//@ compile-flags: -Zno-profiler-runtime
33
//@ revisions: default y yes on true_ all
44
//@ [default] compile-flags: -Cinstrument-coverage
55
//@ [y] compile-flags: -Cinstrument-coverage=y

0 commit comments

Comments
 (0)