From a9e1e43b561aa1c3d5500b5b8b82c6e3ba05cc6c Mon Sep 17 00:00:00 2001 From: Zalathar Date: Thu, 2 Nov 2023 17:40:40 +1100 Subject: [PATCH] Add UI tests for values accepted by `-C symbol-mangling-version` --- src/tools/tidy/src/ui_tests.rs | 2 +- tests/ui/symbol-mangling-version/bad-value.bad.stderr | 2 ++ tests/ui/symbol-mangling-version/bad-value.blank.stderr | 2 ++ tests/ui/symbol-mangling-version/bad-value.no-value.stderr | 2 ++ tests/ui/symbol-mangling-version/bad-value.rs | 6 ++++++ tests/ui/symbol-mangling-version/stable.rs | 5 +++++ tests/ui/symbol-mangling-version/unstable.legacy.stderr | 2 ++ tests/ui/symbol-mangling-version/unstable.rs | 6 ++++++ 8 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 tests/ui/symbol-mangling-version/bad-value.bad.stderr create mode 100644 tests/ui/symbol-mangling-version/bad-value.blank.stderr create mode 100644 tests/ui/symbol-mangling-version/bad-value.no-value.stderr create mode 100644 tests/ui/symbol-mangling-version/bad-value.rs create mode 100644 tests/ui/symbol-mangling-version/stable.rs create mode 100644 tests/ui/symbol-mangling-version/unstable.legacy.stderr create mode 100644 tests/ui/symbol-mangling-version/unstable.rs diff --git a/src/tools/tidy/src/ui_tests.rs b/src/tools/tidy/src/ui_tests.rs index dcf218bc18954..7e24793adee0e 100644 --- a/src/tools/tidy/src/ui_tests.rs +++ b/src/tools/tidy/src/ui_tests.rs @@ -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 diff --git a/tests/ui/symbol-mangling-version/bad-value.bad.stderr b/tests/ui/symbol-mangling-version/bad-value.bad.stderr new file mode 100644 index 0000000000000..c36c73c6069f1 --- /dev/null +++ b/tests/ui/symbol-mangling-version/bad-value.bad.stderr @@ -0,0 +1,2 @@ +error: incorrect value `bad-value` for codegen option `symbol-mangling-version` - either `legacy` or `v0` (RFC 2603) was expected + diff --git a/tests/ui/symbol-mangling-version/bad-value.blank.stderr b/tests/ui/symbol-mangling-version/bad-value.blank.stderr new file mode 100644 index 0000000000000..0e70af5b8ffbe --- /dev/null +++ b/tests/ui/symbol-mangling-version/bad-value.blank.stderr @@ -0,0 +1,2 @@ +error: incorrect value `` for codegen option `symbol-mangling-version` - either `legacy` or `v0` (RFC 2603) was expected + diff --git a/tests/ui/symbol-mangling-version/bad-value.no-value.stderr b/tests/ui/symbol-mangling-version/bad-value.no-value.stderr new file mode 100644 index 0000000000000..77013b72b6c1d --- /dev/null +++ b/tests/ui/symbol-mangling-version/bad-value.no-value.stderr @@ -0,0 +1,2 @@ +error: codegen option `symbol-mangling-version` requires either `legacy` or `v0` (RFC 2603) (C symbol-mangling-version=) + diff --git a/tests/ui/symbol-mangling-version/bad-value.rs b/tests/ui/symbol-mangling-version/bad-value.rs new file mode 100644 index 0000000000000..7623857d49e81 --- /dev/null +++ b/tests/ui/symbol-mangling-version/bad-value.rs @@ -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() {} diff --git a/tests/ui/symbol-mangling-version/stable.rs b/tests/ui/symbol-mangling-version/stable.rs new file mode 100644 index 0000000000000..dac9bb18d1c3f --- /dev/null +++ b/tests/ui/symbol-mangling-version/stable.rs @@ -0,0 +1,5 @@ +// check-pass +// revisions: v0 +// [v0] compile-flags: -Csymbol-mangling-version=v0 + +fn main() {} diff --git a/tests/ui/symbol-mangling-version/unstable.legacy.stderr b/tests/ui/symbol-mangling-version/unstable.legacy.stderr new file mode 100644 index 0000000000000..c5b359b41bd9d --- /dev/null +++ b/tests/ui/symbol-mangling-version/unstable.legacy.stderr @@ -0,0 +1,2 @@ +error: `-C symbol-mangling-version=legacy` requires `-Z unstable-options` + diff --git a/tests/ui/symbol-mangling-version/unstable.rs b/tests/ui/symbol-mangling-version/unstable.rs new file mode 100644 index 0000000000000..df87a39cdfbd1 --- /dev/null +++ b/tests/ui/symbol-mangling-version/unstable.rs @@ -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() {}