| Index: include/llvm/Bitcode/NaCl/NaClBitcodeMunge.h
|
| diff --git a/include/llvm/Bitcode/NaCl/NaClBitcodeMunge.h b/include/llvm/Bitcode/NaCl/NaClBitcodeMunge.h
|
| index 2281a222a8a43fb8db1cc39fd3196db69bc92031..495cdf402a3a7eb95ba5aee107deb6e9e4038c9c 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.
|
| + std::vector<uint64_t> 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,17 @@ 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
|
| + /// errstream so that they can be tested.
|
| + 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 +274,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.
|
|
|