From 8d8c057eabf56d9f83b14334c8107fc7217f67c7 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Thu, 13 Sep 2018 20:00:21 +0000 Subject: Fix a couple of mangling canonicalizer corner case bugs. Summary: The hash computed for an ArrayType was different when first constructed versus when later profiled due to the constructor default argument, and we were not tracking constructor / destructor variant as part of the mangled name AST, leading to incorrect equivalences. Reviewers: erik.pilkington Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D51463 llvm-svn: 342166 --- .../Support/ItaniumManglingCanonicalizerTest.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'llvm/unittests/Support') diff --git a/llvm/unittests/Support/ItaniumManglingCanonicalizerTest.cpp b/llvm/unittests/Support/ItaniumManglingCanonicalizerTest.cpp index b8a42f64f89..2fd6bd8c558 100644 --- a/llvm/unittests/Support/ItaniumManglingCanonicalizerTest.cpp +++ b/llvm/unittests/Support/ItaniumManglingCanonicalizerTest.cpp @@ -233,6 +233,23 @@ static std::vector getTestcases() { }, {} }, + + // Check that ctor and dtor variants are considered distinct. + { + {}, + {{"_ZN1XC1Ev"}, {"_ZN1XC2Ev"}, {"_ZN1XD1Ev"}, {"_ZN1XD2Ev"}} + }, + + // Ensure array types with and without bounds are handled properly. + { + { + {FragmentKind::Type, "A_i", "A1_f"}, + }, + { + {"_Z1fRA_i", "_Z1fRA_i", "_Z1fRA1_f"}, + {"_Z1fRA1_i"}, {"_Z1fRA_f"}, + } + }, }; } -- cgit v1.2.3