Skip to content

Commit 3bcaab0

Browse files
committed
gccrs: Fix scan-gimple testcases on LE platforms.
gcc/testsuite/ChangeLog: * rust/compile/builtin_macro_eager1.rs: Switch to scan-assembler directive as the GIMPLE dump does not contain strings on LE. * rust/compile/builtin_macro_recurse2.rs: Likewise.
1 parent 70ccc4c commit 3bcaab0

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed

gcc/testsuite/rust/compile/macros/builtin/eager1.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ macro_rules! b {
1515
}
1616

1717
fn main() {
18-
// { dg-final { scan-tree-dump-times {"test1canary"} 1 gimple } }
18+
// { dg-final { scan-assembler {"test1canary"} } }
1919
let _ = concat!(a!(), 1, b!());
2020
// should not error
2121
concat!(a!(), true, b!(),);

gcc/testsuite/rust/compile/macros/builtin/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-tree-dump-times {"abheyho"} 1 gimple } }
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)