From 8e94761a94162f43e6c3e9bfbbc5005da3dbeea5 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Tue, 29 Mar 2022 13:09:28 -0700 Subject: [PATCH] Add test of macro calls inside extern block --- tests/source/extern.rs | 13 +++++++++++++ tests/target/extern.rs | 13 +++++++++++++ 2 files changed, 26 insertions(+) diff --git a/tests/source/extern.rs b/tests/source/extern.rs index d0a033b1243..5b981385d2b 100644 --- a/tests/source/extern.rs +++ b/tests/source/extern.rs @@ -77,3 +77,16 @@ unsafe fn foo( extern { } + +macro_rules! x { + ($tt:tt) => {}; +} + +extern "macros" { + x!(ident); + // x!(#); FIXME + x![ident]; + // x![#]; FIXME + x! {ident} + x! {#} +} diff --git a/tests/target/extern.rs b/tests/target/extern.rs index 44ed6d4b475..570d21c17df 100644 --- a/tests/target/extern.rs +++ b/tests/target/extern.rs @@ -82,3 +82,16 @@ pub fn freopen( } extern "C" {} + +macro_rules! x { + ($tt:tt) => {}; +} + +extern "macros" { + x!(ident); + // x!(#); FIXME + x![ident]; + // x![#]; FIXME + x! {ident} + x! {#} +}