[committed,70/88] gccrs: testsuite: Add empty string macro test

Message ID 20230405140411.3016563-71-arthur.cohen@embecosm.com
State Accepted
Headers
Series [committed,01/88] gccrs: fatal_error_flag: Fix typo in error message |

Checks

Context Check Description
snail/gcc-patch-check success Github commit url

Commit Message

Arthur Cohen April 5, 2023, 2:03 p.m. UTC
  From: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>

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
  

Patch

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 00000000000..dcc53b73b19
--- /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 00000000000..6cf835ba9bd
--- /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" }
+}