From: Pierre-Emmanuel Patry Date: Thu, 9 Feb 2023 17:24:42 +0000 (+0100) Subject: gccrs: testsuite: Add empty string macro test X-Git-Tag: basepoints/gcc-14~113 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7b00a80c9df488de64f4c166af07bcb9bb3e4c6d;p=thirdparty%2Fgcc.git gccrs: testsuite: Add empty string macro test Add two new tests with empty string for include_str and include_bytes macros. gcc/testsuite/ChangeLog: * rust/compile/issue-1830_bytes.rs: New test. * rust/compile/issue-1830_str.rs: New test. Signed-off-by: Pierre-Emmanuel Patry --- diff --git a/gcc/testsuite/rust/compile/issue-1830_bytes.rs b/gcc/testsuite/rust/compile/issue-1830_bytes.rs new file mode 100644 index 000000000000..dcc53b73b19a --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-1830_bytes.rs @@ -0,0 +1,8 @@ +#[rustc_builtin_macro] +macro_rules! include_bytes { + () => {{}}; +} + +fn main() { + include_bytes!(""); // { dg-excess-errors "Is a directory" } +} diff --git a/gcc/testsuite/rust/compile/issue-1830_str.rs b/gcc/testsuite/rust/compile/issue-1830_str.rs new file mode 100644 index 000000000000..6cf835ba9bd5 --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-1830_str.rs @@ -0,0 +1,8 @@ +#[rustc_builtin_macro] +macro_rules! include_str { + () => {{}}; +} + +fn main() { + include_str!(""); // { dg-excess-errors "Is a directory" } +}