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

More fixes for running the test suite on a bare metal target #116263

Merged
merged 2 commits into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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: 6 additions & 0 deletions src/tools/compiletest/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,8 @@ pub struct TargetCfg {
pub(crate) sanitizers: Vec<Sanitizer>,
#[serde(rename = "supports-xray", default)]
pub(crate) xray: bool,
#[serde(default = "default_reloc_model")]
pub(crate) relocation_model: String,
}

impl TargetCfg {
Expand All @@ -592,6 +594,10 @@ fn default_os() -> String {
"none".into()
}

fn default_reloc_model() -> String {
"pic".into()
}

#[derive(Eq, PartialEq, Clone, Debug, Default, serde::Deserialize)]
#[serde(rename_all = "kebab-case")]
pub enum Endian {
Expand Down
5 changes: 5 additions & 0 deletions src/tools/compiletest/src/header/needs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@ pub(super) fn handle_needs(
condition: config.target_cfg().dynamic_linking,
ignore_reason: "ignored on targets without dynamic linking",
},
Need {
name: "needs-relocation-model-pic",
condition: config.target_cfg().relocation_model == "pic",
ignore_reason: "ignored on targets without PIC relocation model",
},
];

let (name, comment) = match ln.split_once([':', ' ']) {
Expand Down
1 change: 1 addition & 0 deletions tests/incremental/change_crate_dep_kind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// needs-unwind
// revisions:cfail1 cfail2
// compile-flags: -Z query-dep-graph -Cpanic=unwind
// needs-unwind
// build-pass (FIXME(62277): could be check-pass?)

#![feature(panic_unwind)]
Expand Down
3 changes: 1 addition & 2 deletions tests/ui/abi/relocation_model_pic.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// run-pass
// compile-flags: -C relocation-model=pic
// ignore-emscripten no pic
// ignore-wasm
// needs-relocation-model-pic

#![feature(cfg_relocation_model)]

Expand Down
1 change: 1 addition & 0 deletions tests/ui/panics/short-ice-remove-middle-frames-2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// run-fail
// check-run-results
// exec-env:RUST_BACKTRACE=1
// needs-unwind
// ignore-android FIXME #17520
// ignore-wasm no panic support
// ignore-openbsd no support for libbacktrace without filename
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
thread 'main' panicked at $DIR/short-ice-remove-middle-frames-2.rs:56:5:
thread 'main' panicked at $DIR/short-ice-remove-middle-frames-2.rs:57:5:
debug!!!
stack backtrace:
0: std::panicking::begin_panic
Expand Down
1 change: 1 addition & 0 deletions tests/ui/panics/short-ice-remove-middle-frames.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// run-fail
// check-run-results
// exec-env:RUST_BACKTRACE=1
// needs-unwind
// ignore-android FIXME #17520
// ignore-wasm no panic support
// ignore-openbsd no support for libbacktrace without filename
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/panics/short-ice-remove-middle-frames.run.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
thread 'main' panicked at $DIR/short-ice-remove-middle-frames.rs:52:5:
thread 'main' panicked at $DIR/short-ice-remove-middle-frames.rs:53:5:
debug!!!
stack backtrace:
0: std::panicking::begin_panic
Expand Down
Loading