Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(120)

Side by Side Diff: src/BitcodeMunge.h

Issue 800883006: Add ability to test parsing of bitcode records in Subzero. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix nits. Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698