| Index: include/llvm/Bitcode/NaCl/NaClBitcodeMunge.h
|
| diff --git a/include/llvm/Bitcode/NaCl/NaClBitcodeMunge.h b/include/llvm/Bitcode/NaCl/NaClBitcodeMunge.h
|
| index 03438e39c67308b7abd73dc45f1a71df4b699bab..31a5c4733636811b5e2828cf94fe335751303898 100644
|
| --- a/include/llvm/Bitcode/NaCl/NaClBitcodeMunge.h
|
| +++ b/include/llvm/Bitcode/NaCl/NaClBitcodeMunge.h
|
| @@ -139,6 +139,8 @@ protected:
|
| std::string FatalBuffer;
|
| // The stream to write the fatal message to.
|
| raw_string_ostream FatalStream;
|
| + // The stack of maximum abbreviation indices allowed by block enter record.
|
| + SmallVector<uint64_t, 3> AbbrevIndexLimitStack;
|
|
|
| // Records that an error occurred, and returns stream to print error
|
| // message to.
|
| @@ -197,7 +199,8 @@ public:
|
| /// Creates a bitcode munger, based on the given array of values.
|
| NaClObjDumpMunger(const uint64_t Records[], size_t RecordsSize,
|
| uint64_t RecordTerminator)
|
| - : NaClBitcodeMunger(Records, RecordsSize, RecordTerminator) {}
|
| + : NaClBitcodeMunger(Records, RecordsSize, RecordTerminator),
|
| + RunAsDeathTest(false) {}
|
|
|
| /// Runs function NaClObjDump on the sequence of records associated
|
| /// with the instance. The memory buffer containing the bitsequence
|
| @@ -215,6 +218,18 @@ public:
|
| NoAssembly);
|
| }
|
|
|
| + /// Returns true if running as death test.
|
| + bool getRunAsDeathTest() const {
|
| + return RunAsDeathTest;
|
| + }
|
| +
|
| + /// Sets death test flag. When true, output will be redirected to
|
| + /// the errs() (rather than buffered) so that the test can be
|
| + /// debugged.
|
| + void setRunAsDeathTest(bool NewValue) {
|
| + RunAsDeathTest = NewValue;
|
| + }
|
| +
|
| /// Same as above except it runs function NaClObjDump with flags
|
| /// NoRecords and NoAssembly set to false, and AddHeader set to true.
|
| bool runTest(const char *TestName) {
|
| @@ -260,6 +275,11 @@ public:
|
| size_t MungesSize) {
|
| return runTestWithFlags(TestName, Munges, MungesSize, true, true, true);
|
| }
|
| +
|
| +private:
|
| + // Flag to redirect dump stream if running death test.
|
| + bool RunAsDeathTest;
|
| +
|
| };
|
|
|
| // Class to run tests for function NaClParseBitcodeFile.
|
|
|