diff options
author | liushuyu <liushuyu011@gmail.com> | 2022-09-26 22:30:33 -0600 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2023-01-31 14:16:52 +0100 |
commit | c6c4342273a7d2cce711f292b85956a84768349e (patch) | |
tree | c8b84befc6ea2e6d8500b7eec457616056c154e2 /gcc | |
parent | e88ce5cc68478d20133bc3afd9f4d24a3db47007 (diff) | |
download | gcc-c6c4342273a7d2cce711f292b85956a84768349e.zip gcc-c6c4342273a7d2cce711f292b85956a84768349e.tar.gz gcc-c6c4342273a7d2cce711f292b85956a84768349e.tar.bz2 |
gccrs: testsuite/rust: add a testcase for testing ...
... builtin macro and decl macro mixed expansion
gcc/testsuite/ChangeLog:
* rust/compile/builtin_macro_recurse.rs: New test.
Signed-off-by: Zixing Liu <liushuyu011@gmail.com>
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/rust/compile/builtin_macro_recurse.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/rust/compile/builtin_macro_recurse.rs b/gcc/testsuite/rust/compile/builtin_macro_recurse.rs new file mode 100644 index 0000000..0b516fd --- /dev/null +++ b/gcc/testsuite/rust/compile/builtin_macro_recurse.rs @@ -0,0 +1,21 @@ +// { dg-additional-options "-fdump-tree-gimple" } + +#[rustc_builtin_macro] +macro_rules! concat { + () => {{}}; +} + +macro_rules! a { + () => { "test" }; +} + +macro_rules! b { + () => { "canary" }; +} + +fn main() { + // { dg-final { scan-tree-dump-times {"test1canary"} 1 gimple } } + let _ = concat!(a!(), 1, b!()); + // should not error + concat!(a!(), true, b!(),); +} |