Skip to content

Commit

Permalink
Add UI tests for values accepted by -C symbol-mangling-version
Browse files Browse the repository at this point in the history
  • Loading branch information
Zalathar committed Nov 2, 2023
1 parent 42e1e12 commit a9e1e43
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/tools/tidy/src/ui_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use std::path::{Path, PathBuf};
const ENTRY_LIMIT: usize = 900;
// FIXME: The following limits should be reduced eventually.
const ISSUES_ENTRY_LIMIT: usize = 1854;
const ROOT_ENTRY_LIMIT: usize = 866;
const ROOT_ENTRY_LIMIT: usize = 867;

const EXPECTED_TEST_FILE_EXTENSIONS: &[&str] = &[
"rs", // test source files
Expand Down
2 changes: 2 additions & 0 deletions tests/ui/symbol-mangling-version/bad-value.bad.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
error: incorrect value `bad-value` for codegen option `symbol-mangling-version` - either `legacy` or `v0` (RFC 2603) was expected

2 changes: 2 additions & 0 deletions tests/ui/symbol-mangling-version/bad-value.blank.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
error: incorrect value `` for codegen option `symbol-mangling-version` - either `legacy` or `v0` (RFC 2603) was expected

2 changes: 2 additions & 0 deletions tests/ui/symbol-mangling-version/bad-value.no-value.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
error: codegen option `symbol-mangling-version` requires either `legacy` or `v0` (RFC 2603) (C symbol-mangling-version=<value>)

6 changes: 6 additions & 0 deletions tests/ui/symbol-mangling-version/bad-value.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// revisions: no-value blank bad
// [no-value] compile-flags: -Csymbol-mangling-version
// [blank] compile-flags: -Csymbol-mangling-version=
// [bad] compile-flags: -Csymbol-mangling-version=bad-value

fn main() {}
5 changes: 5 additions & 0 deletions tests/ui/symbol-mangling-version/stable.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// check-pass
// revisions: v0
// [v0] compile-flags: -Csymbol-mangling-version=v0

fn main() {}
2 changes: 2 additions & 0 deletions tests/ui/symbol-mangling-version/unstable.legacy.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
error: `-C symbol-mangling-version=legacy` requires `-Z unstable-options`

6 changes: 6 additions & 0 deletions tests/ui/symbol-mangling-version/unstable.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// revisions: legacy legacy-ok
// [legacy] compile-flags: -Csymbol-mangling-version=legacy
// [legacy-ok] check-pass
// [legacy-ok] compile-flags: -Zunstable-options -Csymbol-mangling-version=legacy

fn main() {}

0 comments on commit a9e1e43

Please sign in to comment.