diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2018-09-13 20:00:21 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2018-09-13 20:00:21 +0000 |
| commit | 8d8c057eabf56d9f83b14334c8107fc7217f67c7 (patch) | |
| tree | f3eeaaeecf7e701471cc86f27e1300e26976e874 /llvm/unittests/Support | |
| parent | f9ca6dd8f76ec9047938fd37746611948814edf3 (diff) | |
| download | bcm5719-llvm-8d8c057eabf56d9f83b14334c8107fc7217f67c7.tar.gz bcm5719-llvm-8d8c057eabf56d9f83b14334c8107fc7217f67c7.zip | |
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
Diffstat (limited to 'llvm/unittests/Support')
| -rw-r--r-- | llvm/unittests/Support/ItaniumManglingCanonicalizerTest.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
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<Testcase> 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"}, + } + }, }; } |

