mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-14 21:16:50 +00:00
add needs-relocation-model-pic to compiletest
This commit is contained in:
parent
b8536c1aa1
commit
90f317b2de
@ -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 {
|
||||
@ -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 {
|
||||
|
@ -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([':', ' ']) {
|
||||
|
@ -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)]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user