OLD | NEW |
(Empty) | |
| 1 //===- llvm/unittest/Bitcode/NaClMungeTest.h - Test munging utils ---------===// |
| 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 // Contains common utilities used in bitcode munge tests. |
| 11 |
| 12 #ifndef LLVM_UNITTEST_BITCODE_NACLMUNGETEST_H |
| 13 #define LLVM_UNITTEST_BITCODE_NACLMUNGETEST_H |
| 14 |
| 15 #include "llvm/ADT/STLExtras.h" |
| 16 #include "llvm/Bitcode/NaCl/NaClBitcodeMunge.h" |
| 17 |
| 18 #include "gtest/gtest.h" |
| 19 |
| 20 namespace naclmungetest { |
| 21 |
| 22 const uint64_t Terminator = 0x5768798008978675LL; |
| 23 |
| 24 #define ARRAY(name) name, array_lengthof(name) |
| 25 |
| 26 #define ARRAY_TERM(name) ARRAY(name), Terminator |
| 27 |
| 28 inline std::string stringify(llvm::NaClMungedBitcode &MungedBitcode) { |
| 29 std::string Buffer; |
| 30 llvm::raw_string_ostream StrBuf(Buffer); |
| 31 MungedBitcode.print(StrBuf); |
| 32 return StrBuf.str(); |
| 33 } |
| 34 |
| 35 inline std::string stringify(llvm::NaClBitcodeMunger &Munger) { |
| 36 return stringify(Munger.getMungedBitcode()); |
| 37 } |
| 38 |
| 39 } // end of namespace naclmungetest |
| 40 |
| 41 #endif // end LLVM_UNITTEST_BITCODE_NACLMUNGETEST_H |
OLD | NEW |