From: Owen Avery Date: Wed, 4 Sep 2024 02:49:15 +0000 (-0400) Subject: gccrs: Fix v0-mangle1.rs test when run with ASAN X-Git-Tag: basepoints/gcc-16~1195 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=99cbcd7c45354e334f6c30a937c96cd9962b583d;p=thirdparty%2Fgcc.git gccrs: Fix v0-mangle1.rs test when run with ASAN gcc/rust/ChangeLog: * util/rust-canonical-path.h (CanonicalPath::CanonicalPath): Properly initialize crate_num with copy constructor. gcc/testsuite/ChangeLog: * rust/compile/v0-mangle1.rs: Make v0-mangle test more crate_num agnostic. Signed-off-by: Owen Avery --- diff --git a/gcc/rust/util/rust-canonical-path.h b/gcc/rust/util/rust-canonical-path.h index af151c2db69..4d8f9542c8b 100644 --- a/gcc/rust/util/rust-canonical-path.h +++ b/gcc/rust/util/rust-canonical-path.h @@ -46,7 +46,9 @@ namespace Resolver { class CanonicalPath { public: - CanonicalPath (const CanonicalPath &other) : segs (other.segs) {} + CanonicalPath (const CanonicalPath &other) + : segs (other.segs), crate_num (other.crate_num) + {} CanonicalPath &operator= (const CanonicalPath &other) { diff --git a/gcc/testsuite/rust/compile/v0-mangle1.rs b/gcc/testsuite/rust/compile/v0-mangle1.rs index a34f1a70112..04c546e351a 100644 --- a/gcc/testsuite/rust/compile/v0-mangle1.rs +++ b/gcc/testsuite/rust/compile/v0-mangle1.rs @@ -36,7 +36,7 @@ fn main() { // cf. rustc 1.72.0: _RNvNtCshIBIgX6Bzox_10v0_mangle18module_a3bar module_a::bar(); - // { dg-final { scan-assembler "_R.*NvNtNtC10v0_mangle18module_a8module_b3baz" } } + // { dg-final { scan-assembler "_R.*NvNtNtC.*10v0_mangle18module_a8module_b3baz" } } // cf. rustc 1.72.0: _RNvNtNtCshIBIgX6Bzox_10v0_mangle18module_a8module_b3baz module_a::module_b::baz();