public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Thomas Schwinge <tschwinge@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc/devel/rust/master] builtin_macros: Add test for file!() Date: Wed, 8 Jun 2022 12:12:03 +0000 (GMT) [thread overview] Message-ID: <20220608121203.D2CAA381667B@sourceware.org> (raw) https://gcc.gnu.org/g:8cc50f2d23fc085801ea21237b68b5cb27efd291 commit 8cc50f2d23fc085801ea21237b68b5cb27efd291 Author: Arthur Cohen <arthur.cohen@embecosm.com> Date: Wed Feb 23 15:51:15 2022 +0100 builtin_macros: Add test for file!() Diff: --- gcc/testsuite/rust/execute/torture/builtin_macros1.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/gcc/testsuite/rust/execute/torture/builtin_macros1.rs b/gcc/testsuite/rust/execute/torture/builtin_macros1.rs new file mode 100644 index 00000000000..d68f62f5175 --- /dev/null +++ b/gcc/testsuite/rust/execute/torture/builtin_macros1.rs @@ -0,0 +1,18 @@ +// { dg-output "rust/execute/torture/builtin_macros1.rs" } +macro_rules! file { + () => {{}}; +} + +extern "C" { + fn printf(fmt: *const i8, ...); +} + +fn print(s: &str) { + printf("%s\n\0" as *const str as *const i8, s); +} + +fn main() -> i32 { + print(file!()); + + 0 +}
reply other threads:[~2022-06-08 12:12 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220608121203.D2CAA381667B@sourceware.org \ --to=tschwinge@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).