Skip to content

Commit 4fdef02

Browse files
committed
wip: Attempt to fix MacOS regression
1 parent 5f4691f commit 4fdef02

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

gcc/testsuite/rust/compile/builtin_macro_recurse2.rs

+24-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,29 @@ macro_rules! a {
1515
};
1616
}
1717

18+
extern "C" {
19+
fn printf(fmt: *const i8, ...);
20+
}
21+
22+
fn print_ptr(s: &str) {
23+
unsafe {
24+
printf("%p\n\0" as *const str as *const i8, s as *const str);
25+
}
26+
}
27+
28+
fn print_str(s: &str) {
29+
unsafe {
30+
printf(
31+
"%s\n\0" as *const str as *const i8,
32+
s as *const str as *const i8,
33+
);
34+
}
35+
}
36+
37+
// { dg-final { scan-assembler {"abheyho"} } }
38+
static S: &str = concat!("a", 'b', a!(), a!(b c d e f a!()), '\0');
39+
1840
fn main() {
19-
// { dg-final { scan-assembler {"abheyho"} } }
20-
let _ = concat!("a", 'b', a!(), a!(b c d e f a!()), '\0');
41+
print_ptr(S);
42+
print_str(S);
2143
}

0 commit comments

Comments
 (0)