Skip to content

Commit 8cc50f2

Browse files
committed
builtin_macros: Add test for file!()
1 parent 62ab4d6 commit 8cc50f2

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// { dg-output "rust/execute/torture/builtin_macros1.rs" }
2+
macro_rules! file {
3+
() => {{}};
4+
}
5+
6+
extern "C" {
7+
fn printf(fmt: *const i8, ...);
8+
}
9+
10+
fn print(s: &str) {
11+
printf("%s\n\0" as *const str as *const i8, s);
12+
}
13+
14+
fn main() -> i32 {
15+
print(file!());
16+
17+
0
18+
}

0 commit comments

Comments
 (0)