From ebd9193b57750faabaeed0f28acc23fb38d1d06b Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Tue, 1 Mar 2016 19:15:06 +0000 Subject: Move ObjectYAML code to a new library. It is only ever used by obj2yaml and yaml2obj. No point in linking it everywhere. llvm-svn: 262368 --- llvm/unittests/MC/CMakeLists.txt | 1 - llvm/unittests/MC/YAMLTest.cpp | 38 -------------------------------------- 2 files changed, 39 deletions(-) delete mode 100644 llvm/unittests/MC/YAMLTest.cpp (limited to 'llvm/unittests/MC') diff --git a/llvm/unittests/MC/CMakeLists.txt b/llvm/unittests/MC/CMakeLists.txt index 7c39f439823..c760c0267a9 100644 --- a/llvm/unittests/MC/CMakeLists.txt +++ b/llvm/unittests/MC/CMakeLists.txt @@ -10,5 +10,4 @@ add_llvm_unittest(MCTests DwarfLineTables.cpp StringTableBuilderTest.cpp TargetRegistry.cpp - YAMLTest.cpp ) diff --git a/llvm/unittests/MC/YAMLTest.cpp b/llvm/unittests/MC/YAMLTest.cpp deleted file mode 100644 index 09709ad73fc..00000000000 --- a/llvm/unittests/MC/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/MC/YAML.h" -#include "llvm/Support/YAMLTraits.h" -#include "gtest/gtest.h" - -using namespace llvm; - -struct BinaryHolder { - yaml::BinaryRef Binary; -}; - -namespace llvm { -namespace yaml { -template <> -struct MappingTraits { - static void mapping(IO &IO, BinaryHolder &BH) { - IO.mapRequired("Binary", BH.Binary); - } -}; -} // end namespace yaml -} // end namespace llvm - -TEST(ObjectYAML, BinaryRef) { - BinaryHolder BH; - SmallVector Buf; - llvm::raw_svector_ostream OS(Buf); - yaml::Output YOut(OS); - YOut << BH; - EXPECT_NE(OS.str().find("''"), StringRef::npos); -} -- cgit v1.2.3