1 //===- llvm/unittest/Object/YAMLTest.cpp - Tests for Object YAML ----------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #include "llvm/MC/YAML.h"
11 #include "llvm/Support/YAMLTraits.h"
12 #include "gtest/gtest.h"
17 yaml::BinaryRef Binary;
23 struct MappingTraits<BinaryHolder> {
24 static void mapping(IO &IO, BinaryHolder &BH) {
25 IO.mapRequired("Binary", BH.Binary);
28 } // end namespace yaml
29 } // end namespace llvm
31 TEST(ObjectYAML, BinaryRef) {
33 SmallVector<char, 32> Buf;
34 llvm::raw_svector_ostream OS(Buf);
35 yaml::Output YOut(OS);
37 EXPECT_NE(OS.str().find("''"), StringRef::npos);