public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/rust/master] builtin_macros: Add test for file!()
@ 2022-06-08 12:12 Thomas Schwinge
0 siblings, 0 replies; only message in thread
From: Thomas Schwinge @ 2022-06-08 12:12 UTC (permalink / raw)
To: gcc-cvs
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
+}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-06-08 12:12 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-08 12:12 [gcc/devel/rust/master] builtin_macros: Add test for file!() Thomas Schwinge
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).