Skip to content

Commit

Permalink
wip: Attempt to fix MacOS regression
Browse files Browse the repository at this point in the history
  • Loading branch information
CohenArthur committed Feb 16, 2024
1 parent 5f4691f commit 4fdef02
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions gcc/testsuite/rust/compile/builtin_macro_recurse2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,29 @@ macro_rules! a {
};
}

extern "C" {
fn printf(fmt: *const i8, ...);
}

fn print_ptr(s: &str) {
unsafe {
printf("%p\n\0" as *const str as *const i8, s as *const str);
}
}

fn print_str(s: &str) {
unsafe {
printf(
"%s\n\0" as *const str as *const i8,
s as *const str as *const i8,
);
}
}

// { dg-final { scan-assembler {"abheyho"} } }
static S: &str = concat!("a", 'b', a!(), a!(b c d e f a!()), '\0');

fn main() {
// { dg-final { scan-assembler {"abheyho"} } }
let _ = concat!("a", 'b', a!(), a!(b c d e f a!()), '\0');
print_ptr(S);
print_str(S);
}

0 comments on commit 4fdef02

Please sign in to comment.