expand -Clink-self-contained tests

- update existing tests for stabilization
- ensure `-Clink-self-contained=-linker` is only stable on x64 linux
- test invalid `-Clink-self-contained` components
This commit is contained in:
Rémy Rakic 2025-07-08 09:29:12 +00:00
parent 856c662567
commit e32b1d7126
11 changed files with 47 additions and 1 deletions

View file

@ -1,7 +1,6 @@
// Checks that self-contained linking components cannot be both enabled and disabled at the same
// time on the CLI.
//@ check-fail
//@ revisions: one many
//@ [one] compile-flags: -Clink-self-contained=-linker -Clink-self-contained=+linker -Zunstable-options
//@ [many] compile-flags: -Clink-self-contained=+linker,+crto -Clink-self-contained=-linker,-crto -Zunstable-options

View file

@ -0,0 +1,18 @@
// Check that only `-C link-self-contained=-linker` is stable on x64 linux. Any other value or
// target, needs `-Z unstable-options`.
// ignore-tidy-linelength
//@ revisions: unstable_target_positive unstable_target_negative unstable_positive
//@ [unstable_target_negative] compile-flags: --target=x86_64-unknown-linux-musl -C link-self-contained=-linker --crate-type=rlib
//@ [unstable_target_negative] needs-llvm-components: x86
//@ [unstable_target_positive] compile-flags: --target=x86_64-unknown-linux-musl -C link-self-contained=+linker --crate-type=rlib
//@ [unstable_target_positive] needs-llvm-components: x86
//@ [unstable_positive] compile-flags: --target=x86_64-unknown-linux-gnu -C link-self-contained=+linker --crate-type=rlib
//@ [unstable_positive] needs-llvm-components: x86
#![feature(no_core)]
#![no_core]
//[unstable_target_negative]~? ERROR `-C link-self-contained=-linker` is unstable on the `x86_64-unknown-linux-musl` target
//[unstable_target_positive,unstable_positive]~? ERROR only `-C link-self-contained` values `y`/`yes`/`on`/`n`/`no`/`off`/`-linker` are stable

View file

@ -0,0 +1,2 @@
error: only `-C link-self-contained` values `y`/`yes`/`on`/`n`/`no`/`off`/`-linker` are stable, the `-Z unstable-options` flag must also be passed to use the unstable values

View file

@ -0,0 +1,2 @@
error: `-C link-self-contained=-linker` is unstable on the `x86_64-unknown-linux-musl` target. The `-Z unstable-options` flag must also be passed to use it on this target

View file

@ -0,0 +1,2 @@
error: only `-C link-self-contained` values `y`/`yes`/`on`/`n`/`no`/`off`/`-linker` are stable, the `-Z unstable-options` flag must also be passed to use the unstable values

View file

@ -0,0 +1,2 @@
error: only `-C link-self-contained` values `y`/`yes`/`on`/`n`/`no`/`off`/`-linker` are stable, the `-Z unstable-options` flag must also be passed to use the unstable values

View file

@ -0,0 +1,2 @@
error: only `-C link-self-contained` values `y`/`yes`/`on`/`n`/`no`/`off`/`-linker` are stable, the `-Z unstable-options` flag must also be passed to use the unstable values

View file

@ -0,0 +1,2 @@
error: only `-C link-self-contained` values `y`/`yes`/`on`/`n`/`no`/`off`/`-linker` are stable, the `-Z unstable-options` flag must also be passed to use the unstable values

View file

@ -0,0 +1,13 @@
// Checks that values for `-Clink-self-contained` other than the blanket enable/disable and
// `-linker` require `-Zunstable-options`.
//@ revisions: crto libc unwind sanitizers mingw
//@ [crto] compile-flags: -Clink-self-contained=+crto
//@ [libc] compile-flags: -Clink-self-contained=-libc
//@ [unwind] compile-flags: -Clink-self-contained=+unwind
//@ [sanitizers] compile-flags: -Clink-self-contained=-sanitizers
//@ [mingw] compile-flags: -Clink-self-contained=+mingw
fn main() {}
//~? ERROR only `-C link-self-contained` values `y`/`yes`/`on`/`n`/`no`/`off`/`-linker` are stable

View file

@ -0,0 +1,2 @@
error: only `-C link-self-contained` values `y`/`yes`/`on`/`n`/`no`/`off`/`-linker` are stable, the `-Z unstable-options` flag must also be passed to use the unstable values

View file

@ -0,0 +1,2 @@
error: only `-C link-self-contained` values `y`/`yes`/`on`/`n`/`no`/`off`/`-linker` are stable, the `-Z unstable-options` flag must also be passed to use the unstable values