diff options
author | Pavel Labath <labath@google.com> | 2018-02-23 17:49:26 +0000 |
---|---|---|
committer | Pavel Labath <labath@google.com> | 2018-02-23 17:49:26 +0000 |
commit | b39fca958d70c9682aaa8b87f58aa88449582cc8 (patch) | |
tree | 70fff2b94ecbd7fc0b072b24cc4a234a3eec3186 /lldb/packages/Python/lldbsuite/test/lang/c | |
parent | 523c656e254769c455c5519739cf097dcd2260c7 (diff) | |
download | bcm5719-llvm-b39fca958d70c9682aaa8b87f58aa88449582cc8.tar.gz bcm5719-llvm-b39fca958d70c9682aaa8b87f58aa88449582cc8.zip |
Replace HashStringUsingDJB with llvm::djbHash
Summary:
The llvm function is equivalent to this one. Where possible I tried to
replace const char* with llvm::StringRef to avoid extra strlen
computations. In most places, I was able to track the c string back to
the ConstString it was created from.
I also create a test that verifies we are able to lookup names with
unicode characters, as a bug in the llvm compiler (it accidentally used
a different hash function) meant this was not working until recently.
This also removes the unused ExportTable class.
Reviewers: aprantl, davide
Subscribers: JDevlieghere, lldb-commits
Differential Revision: https://reviews.llvm.org/D43596
llvm-svn: 325927
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/lang/c')
3 files changed, 30 insertions, 0 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/lang/c/unicode/Makefile b/lldb/packages/Python/lldbsuite/test/lang/c/unicode/Makefile new file mode 100644 index 00000000000..efabc4d4335 --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/lang/c/unicode/Makefile @@ -0,0 +1,6 @@ +LEVEL = ../../../make + +C_SOURCES := main.c +CFLAGS_EXTRAS += -finput-charset=UTF-8 -fextended-identifiers -std=c99 + +include $(LEVEL)/Makefile.rules diff --git a/lldb/packages/Python/lldbsuite/test/lang/c/unicode/TestUnicodeSymbols.py b/lldb/packages/Python/lldbsuite/test/lang/c/unicode/TestUnicodeSymbols.py new file mode 100644 index 00000000000..8ca780d7023 --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/lang/c/unicode/TestUnicodeSymbols.py @@ -0,0 +1,19 @@ +# coding=utf8 +import lldb +from lldbsuite.test.lldbtest import * +import lldbsuite.test.lldbutil as lldbutil + + +class TestUnicodeSymbols(TestBase): + + mydir = TestBase.compute_mydir(__file__) + + def test_union_members(self): + self.build() + spec = lldb.SBModuleSpec() + spec.SetFileSpec(lldb.SBFileSpec(self.getBuildArtifact("a.out"))) + module = lldb.SBModule(spec) + self.assertTrue(module.IsValid()) + mytype = module.FindFirstType("foobár") + self.assertTrue(mytype.IsValid()) + self.assertTrue(mytype.IsPointerType()) diff --git a/lldb/packages/Python/lldbsuite/test/lang/c/unicode/main.c b/lldb/packages/Python/lldbsuite/test/lang/c/unicode/main.c new file mode 100644 index 00000000000..ae44dd0edfa --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/lang/c/unicode/main.c @@ -0,0 +1,5 @@ +typedef void *foob\u00E1r; +foob\u00E1r X = 0; +int main() { + return (long)X; +} |