Skip to content

Commit 8e26bf9

Browse files
authored
Unrolled build for rust-lang#140997
Rollup merge of rust-lang#140997 - jieyouxu:link-flags-negative-tests, r=lqd Add negative test coverage for `-Clink-self-contained` and `-Zlinker-features` Noticed while reviewing stabilization rust-lang#140525 that we don't have any negative test coverage for these flags. Feel free to cherry-pick these tests into the stabilization PR, or we can land these before separately. r? `@lqd`
2 parents 7e19eef + a716f1a commit 8e26bf9

13 files changed

+72
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
error: incorrect value `*lld` for codegen option `link-self-contained` - one of: `y`, `yes`, `on`, `n`, `no`, `off`, or a list of enabled (`+` prefix) and disabled (`-` prefix) components: `crto`, `libc`, `unwind`, `linker`, `sanitizers`, `mingw` was expected
2+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
error: incorrect value `` for codegen option `link-self-contained` - one of: `y`, `yes`, `on`, `n`, `no`, `off`, or a list of enabled (`+` prefix) and disabled (`-` prefix) components: `crto`, `libc`, `unwind`, `linker`, `sanitizers`, `mingw` was expected
2+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//! Check that malformed `-Clink-self-contained` invocations are properly rejected.
2+
3+
//@ revisions: no_value
4+
//@[no_value] compile-flags: -Clink-self-contained=
5+
//[no_value]~? ERROR incorrect value `` for codegen option `link-self-contained`
6+
7+
//@ revisions: invalid_modifier
8+
//@[invalid_modifier] compile-flags: -Clink-self-contained=*lld
9+
//[invalid_modifier]~? ERROR incorrect value `*lld` for codegen option `link-self-contained`
10+
11+
//@ revisions: unknown_value
12+
//@[unknown_value] compile-flags: -Clink-self-contained=unknown
13+
//[unknown_value]~? ERROR incorrect value `unknown` for codegen option `link-self-contained`
14+
15+
//@ revisions: unknown_modifier_value
16+
//@[unknown_modifier_value] compile-flags: -Clink-self-contained=-unknown
17+
//[unknown_modifier_value]~? ERROR incorrect value `-unknown` for codegen option `link-self-contained`
18+
19+
//@ revisions: unknown_boolean
20+
//@[unknown_boolean] compile-flags: -Clink-self-contained=maybe
21+
//[unknown_boolean]~? ERROR incorrect value `maybe` for codegen option `link-self-contained`
22+
23+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
error: incorrect value `maybe` for codegen option `link-self-contained` - one of: `y`, `yes`, `on`, `n`, `no`, `off`, or a list of enabled (`+` prefix) and disabled (`-` prefix) components: `crto`, `libc`, `unwind`, `linker`, `sanitizers`, `mingw` was expected
2+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
error: incorrect value `-unknown` for codegen option `link-self-contained` - one of: `y`, `yes`, `on`, `n`, `no`, `off`, or a list of enabled (`+` prefix) and disabled (`-` prefix) components: `crto`, `libc`, `unwind`, `linker`, `sanitizers`, `mingw` was expected
2+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
error: incorrect value `unknown` for codegen option `link-self-contained` - one of: `y`, `yes`, `on`, `n`, `no`, `off`, or a list of enabled (`+` prefix) and disabled (`-` prefix) components: `crto`, `libc`, `unwind`, `linker`, `sanitizers`, `mingw` was expected
2+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
error: incorrect value `*lld` for unstable option `linker-features` - a list of enabled (`+` prefix) and disabled (`-` prefix) features: `lld` was expected
2+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
error: incorrect value `-lld@+lld` for unstable option `linker-features` - a list of enabled (`+` prefix) and disabled (`-` prefix) features: `lld` was expected
2+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
error: incorrect value `` for unstable option `linker-features` - a list of enabled (`+` prefix) and disabled (`-` prefix) features: `lld` was expected
2+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
//! Check that malformed `-Zlinker-features` flags are properly rejected.
2+
3+
//@ revisions: no_value
4+
//@[no_value] compile-flags: -Zlinker-features=
5+
//[no_value]~? ERROR incorrect value `` for unstable option `linker-features`
6+
7+
//@ revisions: invalid_modifier
8+
//@[invalid_modifier] compile-flags: -Zlinker-features=*lld
9+
//[invalid_modifier]~? ERROR incorrect value `*lld` for unstable option `linker-features`
10+
11+
//@ revisions: unknown_value
12+
//@[unknown_value] compile-flags: -Zlinker-features=unknown
13+
//[unknown_value]~? ERROR incorrect value `unknown` for unstable option `linker-features`
14+
15+
//@ revisions: unknown_modifier_value
16+
//@[unknown_modifier_value] compile-flags: -Zlinker-features=-unknown
17+
//[unknown_modifier_value]~? ERROR incorrect value `-unknown` for unstable option `linker-features`
18+
19+
//@ revisions: unknown_boolean
20+
//@[unknown_boolean] compile-flags: -Zlinker-features=maybe
21+
//[unknown_boolean]~? ERROR incorrect value `maybe` for unstable option `linker-features`
22+
23+
//@ revisions: invalid_separator
24+
//@[invalid_separator] compile-flags: -Zlinker-features=-lld@+lld
25+
//[invalid_separator]~? ERROR incorrect value `-lld@+lld` for unstable option `linker-features`
26+
27+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
error: incorrect value `maybe` for unstable option `linker-features` - a list of enabled (`+` prefix) and disabled (`-` prefix) features: `lld` was expected
2+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
error: incorrect value `-unknown` for unstable option `linker-features` - a list of enabled (`+` prefix) and disabled (`-` prefix) features: `lld` was expected
2+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
error: incorrect value `unknown` for unstable option `linker-features` - a list of enabled (`+` prefix) and disabled (`-` prefix) features: `lld` was expected
2+

0 commit comments

Comments
 (0)