Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 //===- BitcodeMunge.cpp - 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. | |
| 11 // | |
| 12 //===----------------------------------------------------------------------===// | |
| 13 | |
| 14 #include "BitcodeMunge.h" | |
| 15 #include "IceCfg.h" | |
| 16 #include "IceClFlags.h" | |
| 17 #include "PNaClTranslator.h" | |
| 18 #include "IceTypes.h" | |
| 19 | |
| 20 namespace IceTest { | |
| 21 | |
| 22 bool IceTest::SubzeroBitcodeMunger::runTest( | |
| 23 const char* TestName, const uint64_t Munges[], size_t MungeSize) { | |
| 24 bool AddHeader = true; | |
|
Jim Stichnoth
2015/01/05 23:38:14
const bool should be better
Karl
2015/01/08 21:35:05
Done.
| |
| 25 setupTest(TestName, Munges, MungeSize, AddHeader); | |
| 26 | |
| 27 Ice::ClFlags Flags; | |
| 28 Flags.AllowErrorRecovery = true; | |
| 29 Ice::GlobalContext Ctx(DumpStream, DumpStream, nullptr, | |
| 30 Ice::IceV_Instructions, Ice::Target_X8632, | |
| 31 Ice::Opt_m1, "", Flags); | |
| 32 Ice::PNaClTranslator Translator(&Ctx, Flags); | |
| 33 Translator.translateBuffer(TestName, MungedInput.get()); | |
| 34 | |
| 35 cleanupTest(); | |
| 36 return Translator.getErrorStatus() == 0; | |
| 37 } | |
| 38 | |
| 39 } // end of namespace IceTest | |
| OLD | NEW |