Skip to content

Commit

Permalink
run cross-lang-lto-pgo-smoketest in CI by renaming it
Browse files Browse the repository at this point in the history
  • Loading branch information
Oneirical committed Aug 2, 2024
1 parent 560e86d commit 290a260
Show file tree
Hide file tree
Showing 12 changed files with 35 additions and 142 deletions.
7 changes: 0 additions & 7 deletions src/tools/run-make-support/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,13 +258,6 @@ impl CompletedProcess {
self
}

/// Checks that `stderr` does not contain the regex pattern `unexpected`.
#[track_caller]
pub fn assert_stderr_not_contains_regex<S: AsRef<str>>(&self, unexpected: S) -> &Self {
assert_not_contains_regex(&self.stdout_utf8(), unexpected);
self
}

#[track_caller]
pub fn assert_exit_code(&self, code: i32) -> &Self {
assert!(self.output.status.code() == Some(code));
Expand Down
6 changes: 6 additions & 0 deletions src/tools/run-make-support/src/external_deps/llvm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,12 @@ impl LlvmObjdump {
self.cmd.arg(path.as_ref());
self
}

/// Disassemble all executable sections found in the input files.
pub fn disassemble(&mut self) -> &mut Self {
self.cmd.arg("-d");
self
}
}

impl LlvmAr {
Expand Down
29 changes: 0 additions & 29 deletions tests/run-make/cross-lang-lto-clang/_Makefile

This file was deleted.

13 changes: 7 additions & 6 deletions tests/run-make/cross-lang-lto-clang/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
// See https://github.com/rust-lang/rust/pull/57514

//@ needs-force-clang-based-tests
// FIXME(#126180): This test doesn't actually run anywhere, because the only
// CI job that sets RUSTBUILD_FORCE_CLANG_BASED_TESTS runs very few tests.
// NOTE(#126180): This test only runs on `x86_64-gnu-debug`, because that CI job sets
// RUSTBUILD_FORCE_CLANG_BASED_TESTS and only runs tests which contain "clang" in their
// name.

use run_make_support::{clang, env_var, llvm_ar, llvm_objdump, rustc, static_lib_name};

Expand All @@ -27,14 +28,14 @@ fn main() {
// Make sure we don't find a call instruction to the function we expect to
// always be inlined.
llvm_objdump()
.arg("-d")
.disassemble()
.input("cmain")
.run()
.assert_stdout_not_contains_regex("call.*rust_always_inlined");
// As a sanity check, make sure we do find a call instruction to a
// non-inlined function
llvm_objdump()
.arg("-d")
.disassemble()
.input("cmain")
.run()
.assert_stdout_contains_regex("call.*rust_never_inlined");
Expand All @@ -49,12 +50,12 @@ fn main() {
.output("rsmain")
.run();
llvm_objdump()
.arg("-d")
.disassemble()
.input("rsmain")
.run()
.assert_stdout_not_contains_regex("call.*c_always_inlined");
llvm_objdump()
.arg("-d")
.disassemble()
.input("rsmain")
.run()
.assert_stdout_contains_regex("call.*c_never_inlined");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,23 @@
// See https://github.com/rust-lang/rust/pull/61036

//@ needs-force-clang-based-tests
// FIXME(#126180): This test doesn't actually run anywhere, because the only
// CI job that sets RUSTBUILD_FORCE_CLANG_BASED_TESTS runs very few tests.
// NOTE(#126180): This test would only run on `x86_64-gnu-debug`, because that CI job sets
// RUSTBUILD_FORCE_CLANG_BASED_TESTS and only runs tests which contain "clang" in their
// name.

//@ needs-profiler-support
// FIXME(Oneirical): Except that due to the reliance on llvm-profdata, this test
// never runs, because `x86_64-gnu-debug` does not have the `profiler_builtins` crate.

//FIXME(Oneirical): There was a strange workaround for MSVC on this test
// which added -C panic=abort to every RUSTC call. It was justified as follows:
// LLVM doesn't support instrumenting binaries that use SEH:

// "LLVM doesn't support instrumenting binaries that use SEH:
// https://bugs.llvm.org/show_bug.cgi?id=41279
// Things work fine with -Cpanic=abort though.
// Things work fine with -Cpanic=abort though."

// This isn't very pertinent, however, as the test does not get run on any
// MSVC platforms.

use run_make_support::{
clang, env_var, has_extension, has_prefix, llvm_ar, llvm_profdata, rfs, run, rustc,
Expand Down
94 changes: 0 additions & 94 deletions tests/run-make/cross-lang-lto-pgo-smoketest/_Makefile

This file was deleted.

7 changes: 5 additions & 2 deletions tests/run-make/cross-lang-lto-riscv-abi/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
//@ needs-force-clang-based-tests
//@ needs-llvm-components riscv

// FIXME(#126180): This test doesn't actually run anywhere, because the only
// CI job that sets RUSTBUILD_FORCE_CLANG_BASED_TESTS runs very few tests.
//@ needs-force-clang-based-tests
// FIXME(#126180): This test can only run on `x86_64-gnu-debug`, because that CI job sets
// RUSTBUILD_FORCE_CLANG_BASED_TESTS and only runs tests which contain "clang" in their
// name.
// However, this test does not run at all as its name does not contain "clang".

use std::path::PathBuf;
use std::process::{Command, Output};
Expand Down
4 changes: 4 additions & 0 deletions tests/run-make/wasm-override-linker/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
// $ RUSTBUILD_FORCE_CLANG_BASED_TESTS=1 ./x.py test tests/run-make/wasm-override-linker/

//@ needs-force-clang-based-tests
// FIXME(#126180): This test can only run on `x86_64-gnu-debug`, because that CI job sets
// RUSTBUILD_FORCE_CLANG_BASED_TESTS and only runs tests which contain "clang" in their
// name.
// However, this test does not run at all as its name does not contain "clang".

use run_make_support::{env_var, rustc, target};

Expand Down

0 comments on commit 290a260

Please sign in to comment.