diff options
author | Stephen Hines <srhines@google.com> | 2014-07-21 00:45:20 -0700 |
---|---|---|
committer | Stephen Hines <srhines@google.com> | 2014-07-21 00:45:20 -0700 |
commit | c6a4f5e819217e1e12c458aed8e7b122e23a3a58 (patch) | |
tree | 81b7dd2bb4370a392f31d332a566c903b5744764 /unittests/Object | |
parent | 19c6fbb3e8aaf74093afa08013134b61fa08f245 (diff) | |
download | external_llvm-c6a4f5e819217e1e12c458aed8e7b122e23a3a58.zip external_llvm-c6a4f5e819217e1e12c458aed8e7b122e23a3a58.tar.gz external_llvm-c6a4f5e819217e1e12c458aed8e7b122e23a3a58.tar.bz2 |
Update LLVM for rebase to r212749.
Includes a cherry-pick of:
r212948 - fixes a small issue with atomic calls
Change-Id: Ib97bd980b59f18142a69506400911a6009d9df18
Diffstat (limited to 'unittests/Object')
-rw-r--r-- | unittests/Object/CMakeLists.txt | 9 | ||||
-rw-r--r-- | unittests/Object/Makefile | 15 | ||||
-rw-r--r-- | unittests/Object/StringTableBuilderTest.cpp | 40 | ||||
-rw-r--r-- | unittests/Object/YAMLTest.cpp | 38 |
4 files changed, 0 insertions, 102 deletions
diff --git a/unittests/Object/CMakeLists.txt b/unittests/Object/CMakeLists.txt deleted file mode 100644 index 580a894..0000000 --- a/unittests/Object/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -set(LLVM_LINK_COMPONENTS - Object - Support - ) - -add_llvm_unittest(ObjectTests - StringTableBuilderTest.cpp - YAMLTest.cpp - ) diff --git a/unittests/Object/Makefile b/unittests/Object/Makefile deleted file mode 100644 index 9062149..0000000 --- a/unittests/Object/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -##===- unittests/Object/Makefile ---------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = ../.. -TESTNAME = Object -LINK_COMPONENTS := object - -include $(LEVEL)/Makefile.config -include $(LLVM_SRC_ROOT)/unittests/Makefile.unittest diff --git a/unittests/Object/StringTableBuilderTest.cpp b/unittests/Object/StringTableBuilderTest.cpp deleted file mode 100644 index 130eb4a..0000000 --- a/unittests/Object/StringTableBuilderTest.cpp +++ /dev/null @@ -1,40 +0,0 @@ -//===----------- StringTableBuilderTest.cpp -------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#include "gtest/gtest.h" -#include "llvm/Object/StringTableBuilder.h" -#include <string> - -using namespace llvm; - -namespace { - -TEST(StringTableBuilderTest, Basic) { - StringTableBuilder B; - - B.add("foo"); - B.add("bar"); - B.add("foobar"); - - B.finalize(); - - std::string Expected; - Expected += '\x00'; - Expected += "foobar"; - Expected += '\x00'; - Expected += "foo"; - Expected += '\x00'; - - EXPECT_EQ(Expected, B.data()); - EXPECT_EQ(1U, B.getOffset("foobar")); - EXPECT_EQ(4U, B.getOffset("bar")); - EXPECT_EQ(8U, B.getOffset("foo")); -} - -} diff --git a/unittests/Object/YAMLTest.cpp b/unittests/Object/YAMLTest.cpp deleted file mode 100644 index 1eb1113..0000000 --- a/unittests/Object/YAMLTest.cpp +++ /dev/null @@ -1,38 +0,0 @@ -//===- llvm/unittest/Object/YAMLTest.cpp - Tests for Object YAML ----------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#include "llvm/Object/YAML.h" -#include "llvm/Support/YAMLTraits.h" -#include "gtest/gtest.h" - -using namespace llvm; - -struct BinaryHolder { - object::yaml::BinaryRef Binary; -}; - -namespace llvm { -namespace yaml { -template <> -struct MappingTraits<BinaryHolder> { - static void mapping(IO &IO, BinaryHolder &BH) { - IO.mapRequired("Binary", BH.Binary); - } -}; -} // end namespace yaml -} // end namespace llvm - -TEST(ObjectYAML, BinaryRef) { - BinaryHolder BH; - SmallVector<char, 32> Buf; - llvm::raw_svector_ostream OS(Buf); - yaml::Output YOut(OS); - YOut << BH; - EXPECT_NE(OS.str().find("''"), StringRef::npos); -} |