Skip to content

Commit 3e051af

Browse files
committed
Add some negative test coverage for malformed -Clink-self-contained flags
1 parent 414482f commit 3e051af

6 files changed

+33
-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+

0 commit comments

Comments
 (0)