]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Fix v0-mangle1.rs test when run with ASAN
authorOwen Avery <powerboat9.gamer@gmail.com>
Wed, 4 Sep 2024 02:49:15 +0000 (22:49 -0400)
committerArthur Cohen <arthur.cohen@embecosm.com>
Wed, 19 Mar 2025 14:32:08 +0000 (15:32 +0100)
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 <powerboat9.gamer@gmail.com>
gcc/rust/util/rust-canonical-path.h
gcc/testsuite/rust/compile/v0-mangle1.rs

index af151c2db697e20f0ada674a756d5d8ee74fe4bd..4d8f9542c8b1c3af470032e9ca7bb0e30d1ce5db 100644 (file)
@@ -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)
   {
index a34f1a70112aa5d7b1144011faeef285ad09e8e7..04c546e351af4018b162b623540c3d4d4f53e4ae 100644 (file)
@@ -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();