[PATCH] D19135: [sanitizers] Teach the internal demangler about Swift names
Mike Aizatsky via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 15 11:28:39 PDT 2016
aizatsky added inline comments.
================
Comment at: lib/sanitizer_common/tests/sanitizer_symbolizer_test.cc:59
@@ +58,3 @@
+TEST(Symbolizer, DemangleCXXAndSwift) {
+ // The Swift name will only be demangled if the Swift runtime is linked in.
+ EXPECT_STREQ("_TtSd", DemangleCXXAndSwift("_TtSd"));
----------------
zaks.anna wrote:
> aizatsky wrote:
> > Let's have two separate test cases: DemangleCXX and DemangleSwift.
> >
> > Let's also make the comment a statement.
> > // Swift names are not demangled in default llvm build because Swift runtime is not linked in.
> > Let's have two separate test cases: DemangleCXX and DemangleSwift.
> It's important to test DemangleCXXAndSwift specifically since it's the only API that others will call and testing it ensures that the chaining works. (DemangleCXX and DemangleSwift are not exposed in the header and should not be.)
I mean this:
TEST(Symbolizer, DemangleCXX) {
EXPECT_STREQ("f1(char*, int)", DemangleCXXAndSwift("_Z2f1Pci"));
EXPECT_STREQ("foo", DemangleCXXAndSwift("foo"));
EXPECT_STREQ("", DemangleCXXAndSwift(""));
}
TEST(Symbolizer, DemangleSwift) {
// ...
EXPECT_STREQ("_TtSd", DemangleCXXAndSwift("_TtSd"));
}
http://reviews.llvm.org/D19135
More information about the llvm-commits
mailing list