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