OLD | NEW |
1 //===- BitcodeMunge.cpp - Subzero Bitcode Munger ----------------*- C++ -*-===// | 1 //===- BitcodeMunge.cpp - Subzero Bitcode Munger ----------------*- C++ -*-===// |
2 // | 2 // |
3 // The LLVM Compiler Infrastructure | 3 // The LLVM Compiler Infrastructure |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 // | 9 // |
10 // Test harness for testing malformed bitcode files in Subzero. | 10 // Test harness for testing malformed bitcode files in Subzero. |
(...skipping 13 matching lines...) Expand all Loading... |
24 size_t MungeSize) { | 24 size_t MungeSize) { |
25 const bool AddHeader = true; | 25 const bool AddHeader = true; |
26 setupTest(TestName, Munges, MungeSize, AddHeader); | 26 setupTest(TestName, Munges, MungeSize, AddHeader); |
27 | 27 |
28 Ice::ClFlags Flags; | 28 Ice::ClFlags Flags; |
29 Flags.AllowErrorRecovery = true; | 29 Flags.AllowErrorRecovery = true; |
30 Flags.GenerateUnitTestMessages = true; | 30 Flags.GenerateUnitTestMessages = true; |
31 Ice::GlobalContext Ctx(DumpStream, DumpStream, nullptr, | 31 Ice::GlobalContext Ctx(DumpStream, DumpStream, nullptr, |
32 Ice::IceV_Instructions, Ice::Target_X8632, Ice::Opt_m1, | 32 Ice::IceV_Instructions, Ice::Target_X8632, Ice::Opt_m1, |
33 "", Flags); | 33 "", Flags); |
34 Ice::PNaClTranslator Translator(&Ctx, Flags); | 34 Ice::PNaClTranslator Translator(&Ctx); |
35 Translator.translateBuffer(TestName, MungedInput.get()); | 35 Translator.translateBuffer(TestName, MungedInput.get()); |
36 | 36 |
37 cleanupTest(); | 37 cleanupTest(); |
38 return Translator.getErrorStatus().value() == 0; | 38 return Translator.getErrorStatus().value() == 0; |
39 } | 39 } |
40 | 40 |
41 } // end of namespace IceTest | 41 } // end of namespace IceTest |
OLD | NEW |