summaryrefslogtreecommitdiffstats
path: root/unittests
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2013-10-25 20:04:25 +0000
committerDavid Blaikie <dblaikie@gmail.com>2013-10-25 20:04:25 +0000
commit7c0c2e56b09fee406ca0bb6e3ac840a3a6ed1160 (patch)
tree455264bc7019214823af65520d261b6de9136811 /unittests
parentb1d39851bf19136fbf5c9cac1d46a463d92b50b8 (diff)
downloadexternal_llvm-7c0c2e56b09fee406ca0bb6e3ac840a3a6ed1160.zip
external_llvm-7c0c2e56b09fee406ca0bb6e3ac840a3a6ed1160.tar.gz
external_llvm-7c0c2e56b09fee406ca0bb6e3ac840a3a6ed1160.tar.bz2
DIEHash: Summary hashing of member functions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193432 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r--unittests/CodeGen/DIEHashTest.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/unittests/CodeGen/DIEHashTest.cpp b/unittests/CodeGen/DIEHashTest.cpp
index fb6f4b3..8d8fc39 100644
--- a/unittests/CodeGen/DIEHashTest.cpp
+++ b/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);
+}
}