From 29e07e06beff540f6aacec89193ace75ae2d2d23 Mon Sep 17 00:00:00 2001 From: Arthur Cohen Date: Wed, 16 Feb 2022 02:11:12 +0100 Subject: macros: Add multiple macro syntax tests --- gcc/testsuite/rust/compile/macro1.rs | 3 +++ gcc/testsuite/rust/compile/macro2.rs | 3 +++ gcc/testsuite/rust/compile/macro3.rs | 3 +++ gcc/testsuite/rust/compile/macro4.rs | 3 +++ gcc/testsuite/rust/compile/macro5.rs | 3 +++ 5 files changed, 15 insertions(+) create mode 100644 gcc/testsuite/rust/compile/macro1.rs create mode 100644 gcc/testsuite/rust/compile/macro2.rs create mode 100644 gcc/testsuite/rust/compile/macro3.rs create mode 100644 gcc/testsuite/rust/compile/macro4.rs create mode 100644 gcc/testsuite/rust/compile/macro5.rs (limited to 'gcc') diff --git a/gcc/testsuite/rust/compile/macro1.rs b/gcc/testsuite/rust/compile/macro1.rs new file mode 100644 index 0000000..8cd9418 --- /dev/null +++ b/gcc/testsuite/rust/compile/macro1.rs @@ -0,0 +1,3 @@ +macro_rules! empty_parens { + () => (); +} diff --git a/gcc/testsuite/rust/compile/macro2.rs b/gcc/testsuite/rust/compile/macro2.rs new file mode 100644 index 0000000..a437655 --- /dev/null +++ b/gcc/testsuite/rust/compile/macro2.rs @@ -0,0 +1,3 @@ +macro_rules! empty_brackets { + [] => []; +} diff --git a/gcc/testsuite/rust/compile/macro3.rs b/gcc/testsuite/rust/compile/macro3.rs new file mode 100644 index 0000000..e5d3e93 --- /dev/null +++ b/gcc/testsuite/rust/compile/macro3.rs @@ -0,0 +1,3 @@ +macro_rules! empty_curlies { + {} => {}; +} diff --git a/gcc/testsuite/rust/compile/macro4.rs b/gcc/testsuite/rust/compile/macro4.rs new file mode 100644 index 0000000..47ff6c9 --- /dev/null +++ b/gcc/testsuite/rust/compile/macro4.rs @@ -0,0 +1,3 @@ +macro_rules! one_keyword { + (kw) => {}; +} diff --git a/gcc/testsuite/rust/compile/macro5.rs b/gcc/testsuite/rust/compile/macro5.rs new file mode 100644 index 0000000..a5d8095 --- /dev/null +++ b/gcc/testsuite/rust/compile/macro5.rs @@ -0,0 +1,3 @@ +macro_rules! rust_keyword { + (fn) => {}; +} -- cgit v1.1