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

Side by Side Diff: unittest/BitcodeMunge.cpp

Issue 1834473002: Allow Subzero to parse function blocks in parallel. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix issues from last patch. Created 4 years, 9 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
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.
11 // 11 //
12 //===----------------------------------------------------------------------===// 12 //===----------------------------------------------------------------------===//
13 13
14 #include "BitcodeMunge.h" 14 #include "BitcodeMunge.h"
15 #include "IceCfg.h" 15 #include "IceCfg.h"
16 #include "IceClFlags.h" 16 #include "IceClFlags.h"
17 #include "PNaClTranslator.h" 17 #include "PNaClTranslator.h"
18 #include "IceTypes.h" 18 #include "IceTypes.h"
19 19
20 namespace IceTest { 20 namespace IceTest {
21 21
22 void IceTest::SubzeroBitcodeMunger::resetMungeFlags() { 22 void IceTest::SubzeroBitcodeMunger::resetMungeFlags() {
23 Flags.setAllowErrorRecovery(true); 23 Flags.setAllowErrorRecovery(true);
24 Flags.setGenerateUnitTestMessages(true); 24 Flags.setGenerateUnitTestMessages(true);
25 Flags.setOptLevel(Ice::Opt_m1); 25 Flags.setOptLevel(Ice::Opt_m1);
26 Flags.setOutFileType(Ice::FT_Iasm); 26 Flags.setOutFileType(Ice::FT_Iasm);
27 Flags.setTargetArch(Ice::Target_X8632); 27 Flags.setTargetArch(Ice::Target_X8632);
28 Flags.setVerbose(Ice::IceV_Instructions); 28 Flags.setVerbose(Ice::IceV_Instructions);
29 Flags.setNumTranslationThreads(0);
30 Flags.setVerbose(Ice::IceV_None);
Jim Stichnoth 2016/03/25 04:31:04 There is already a setVerbose 2 lines above. The
Karl 2016/03/29 17:35:02 Good point. Removing.
29 } 31 }
30 32
31 bool IceTest::SubzeroBitcodeMunger::runTest(const uint64_t Munges[], 33 bool IceTest::SubzeroBitcodeMunger::runTest(const uint64_t Munges[],
32 size_t MungeSize, 34 size_t MungeSize,
33 bool DisableTranslation) { 35 bool DisableTranslation) {
34 const bool AddHeader = true; 36 const bool AddHeader = true;
35 setupTest(Munges, MungeSize, AddHeader); 37 setupTest(Munges, MungeSize, AddHeader);
36 Ice::GlobalContext Ctx(DumpStream, DumpStream, DumpStream, nullptr); 38 Ice::GlobalContext Ctx(DumpStream, DumpStream, DumpStream, nullptr);
39 Ctx.startWorkerThreads();
37 Ice::PNaClTranslator Translator(&Ctx); 40 Ice::PNaClTranslator Translator(&Ctx);
38 const char *BufferName = "Test"; 41 const char *BufferName = "Test";
39 Flags.setDisableTranslation(DisableTranslation); 42 Flags.setDisableTranslation(DisableTranslation);
40 Translator.translateBuffer(BufferName, MungedInput.get()); 43 Translator.translateBuffer(BufferName, MungedInput.get());
Karl 2016/03/29 17:35:02 To be safe, added Ctx.waitForWorkerThreads() here.
41 44
42 cleanupTest(); 45 cleanupTest();
43 return Translator.getErrorStatus().value() == 0; 46 return Translator.getErrorStatus().value() == 0;
44 } 47 }
45 48
46 } // end of namespace IceTest 49 } // end of namespace IceTest
OLDNEW
« src/PNaClTranslator.cpp ('K') | « tests_lit/parse_errs/insertextract-err.ll ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698