]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: testsuite: Add empty string macro test
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Thu, 9 Feb 2023 17:24:42 +0000 (18:24 +0100)
committerArthur Cohen <arthur.cohen@embecosm.com>
Thu, 6 Apr 2023 08:47:23 +0000 (10:47 +0200)
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 [new file with mode: 0644]
gcc/testsuite/rust/compile/issue-1830_str.rs [new file with mode: 0644]

diff --git a/gcc/testsuite/rust/compile/issue-1830_bytes.rs b/gcc/testsuite/rust/compile/issue-1830_bytes.rs
new file mode 100644 (file)
index 0000000..dcc53b7
--- /dev/null
@@ -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 (file)
index 0000000..6cf835b
--- /dev/null
@@ -0,0 +1,8 @@
+#[rustc_builtin_macro]
+macro_rules! include_str {
+    () => {{}};
+}
+
+fn main() {
+    include_str!(""); // { dg-excess-errors "Is a directory" }
+}