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 const bool AddHeader = true; |
| 25 setupTest(TestName, Munges, MungeSize, AddHeader); |
| 26 |
| 27 Ice::ClFlags Flags; |
| 28 Flags.AllowErrorRecovery = true; |
| 29 Flags.GenerateUnitTestMessages = true; |
| 30 Ice::GlobalContext Ctx(DumpStream, DumpStream, nullptr, |
| 31 Ice::IceV_Instructions, Ice::Target_X8632, |
| 32 Ice::Opt_m1, "", Flags); |
| 33 Ice::PNaClTranslator Translator(&Ctx, Flags); |
| 34 Translator.translateBuffer(TestName, MungedInput.get()); |
| 35 |
| 36 cleanupTest(); |
| 37 return Translator.getErrorStatus() == 0; |
| 38 } |
| 39 |
| 40 } // end of namespace IceTest |
OLD | NEW |