diff options
author | David Blaikie <dblaikie@gmail.com> | 2013-10-25 20:04:25 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2013-10-25 20:04:25 +0000 |
commit | 8bc7db777d5ace45ed35c562314a1c2d5f629e8a (patch) | |
tree | a7aa994634c8f1d75dea2211b5668ff567c95a4f /llvm/unittests/CodeGen/DIEHashTest.cpp | |
parent | e5bf24684fbdb41388a66bfd2e5bc9eb94361387 (diff) | |
download | bcm5719-llvm-8bc7db777d5ace45ed35c562314a1c2d5f629e8a.tar.gz bcm5719-llvm-8bc7db777d5ace45ed35c562314a1c2d5f629e8a.zip |
DIEHash: Summary hashing of member functions
llvm-svn: 193432
Diffstat (limited to 'llvm/unittests/CodeGen/DIEHashTest.cpp')
-rw-r--r-- | llvm/unittests/CodeGen/DIEHashTest.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/llvm/unittests/CodeGen/DIEHashTest.cpp b/llvm/unittests/CodeGen/DIEHashTest.cpp index fb6f4b3640a..8d8fc39a30f 100644 --- a/llvm/unittests/CodeGen/DIEHashTest.cpp +++ b/llvm/unittests/CodeGen/DIEHashTest.cpp @@ -496,4 +496,22 @@ TEST(DIEHashTest, NestedType) { // The exact same hash GCC produces for this DIE. ASSERT_EQ(0xde8a3b7b43807f4aULL, MD5Res); } + +// struct { static void func(); }; +TEST(DIEHashTest, MemberFunc) { + DIE Unnamed(dwarf::DW_TAG_structure_type); + DIEInteger One(1); + Unnamed.addValue(dwarf::DW_AT_byte_size, dwarf::DW_FORM_data1, &One); + + DIE *Func = new DIE(dwarf::DW_TAG_subprogram); + DIEString FuncStr(&One, "func"); + Func->addValue(dwarf::DW_AT_name, dwarf::DW_FORM_strp, &FuncStr); + + Unnamed.addChild(Func); + + uint64_t MD5Res = DIEHash().computeTypeSignature(Unnamed); + + // The exact same hash GCC produces for this DIE. + ASSERT_EQ(0xd36a1b6dfb604ba0ULL, MD5Res); +} } |