blob: 91b03224f0a6fba9539cebb047696d9ec4996a28 [file] [log] [blame]
Eric Christopher800a8762013-09-03 21:57:57 +00001//===- llvm/unittest/DebugInfo/DWARFFormValueTest.cpp ---------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#include "../lib/CodeGen/AsmPrinter/DIE.h"
11#include "../lib/CodeGen/AsmPrinter/DIEHash.h"
12#include "llvm/Support/Dwarf.h"
13#include "llvm/Support/Debug.h"
14#include "llvm/Support/Format.h"
15#include "gtest/gtest.h"
16
Eric Christopher800a8762013-09-03 21:57:57 +000017using namespace llvm;
David Blaikiee4df43e2013-10-15 23:00:17 +000018
19namespace {
Eric Christopher800a8762013-09-03 21:57:57 +000020TEST(DIEHashData1Test, DIEHash) {
21 DIEHash Hash;
Benjamin Kramer449a88e2013-09-29 11:29:20 +000022 DIE Die(dwarf::DW_TAG_base_type);
23 DIEInteger Size(4);
24 Die.addValue(dwarf::DW_AT_byte_size, dwarf::DW_FORM_data1, &Size);
25 uint64_t MD5Res = Hash.computeTypeSignature(&Die);
David Blaikiea85ad232013-10-16 22:43:10 +000026 ASSERT_EQ(0x4F68EF1039F8D2BULL, MD5Res);
Eric Christopher800a8762013-09-03 21:57:57 +000027}
28}