From 7b00a80c9df488de64f4c166af07bcb9bb3e4c6d Mon Sep 17 00:00:00 2001
From: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Date: Thu, 9 Feb 2023 18:24:42 +0100
Subject: [PATCH] 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 <pierre-emmanuel.patry@embecosm.com>
---
 gcc/testsuite/rust/compile/issue-1830_bytes.rs | 8 ++++++++
 gcc/testsuite/rust/compile/issue-1830_str.rs   | 8 ++++++++
 2 files changed, 16 insertions(+)
 create mode 100644 gcc/testsuite/rust/compile/issue-1830_bytes.rs
 create mode 100644 gcc/testsuite/rust/compile/issue-1830_str.rs

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" }
+}
-- 
GitLab