Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 //===- BitcodeMunge.h - Subzero Bitcode Munger ------------------*- C++ -*-===// | |
| 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 // Test harness for testing malformed bitcode files in Subzero. Uses NaCl's | |
| 11 // bitcode munger to do this. | |
| 12 // | |
| 13 //===----------------------------------------------------------------------===// | |
| 14 | |
| 15 #ifndef SUBZERO_SRC_BITCODEMUNGE_H | |
|
Jim Stichnoth
2015/01/08 23:45:25
Change this define to reflect the new file locatio
Karl
2015/01/09 16:12:32
Done.
| |
| 16 #define SUBZERO_SRC_BITCODEMUNGE_H | |
| 17 | |
| 18 #include "llvm/Bitcode/NaCl/NaClBitcodeMunge.h" | |
| 19 | |
| 20 namespace IceTest { | |
| 21 | |
| 22 // Class to run tests on subzero's bitcode parser. Runs a Subzero | |
|
Jim Stichnoth
2015/01/08 23:45:25
Capitalize Subzero
Karl
2015/01/09 16:12:32
Done.
| |
| 23 // translation, using (possibly) edited bicode record values. For | |
|
Jim Stichnoth
2015/01/08 23:45:25
bitcode
Karl
2015/01/09 16:12:32
Done.
| |
| 24 // more details on how to represent the input arrays, see | |
| 25 // NaClBitcodeMunge.h. | |
| 26 class SubzeroBitcodeMunger : public llvm::NaClBitcodeMunger { | |
| 27 public: | |
| 28 SubzeroBitcodeMunger(const uint64_t Records[], size_t RecordSize, | |
| 29 uint64_t RecordTerminator) | |
| 30 : llvm::NaClBitcodeMunger(Records, RecordSize, RecordTerminator) {} | |
| 31 | |
| 32 /// Runs PNaClTranslator to translate bitcode records (with defined | |
| 33 /// record Munges), and puts output into DumpResults. Returns true | |
| 34 /// if parse is successful. | |
| 35 bool runTest(const char* TestName, const uint64_t Munges[], | |
| 36 size_t MungeSize); | |
| 37 | |
| 38 /// Same as above, but without any edits. | |
| 39 bool runTest(const char* TestName) { | |
| 40 uint64_t NoMunges[] = {0}; | |
| 41 return runTest(TestName, NoMunges, 0); | |
| 42 } | |
| 43 }; | |
| 44 | |
| 45 } // end of namespace IceTest | |
| 46 | |
| 47 #endif // SUBZERO_SRC_BITCODEMUNGE_H | |
| OLD | NEW |