diff options
Diffstat (limited to 'deps/v8/test/unittests/codegen/source-position-table-unittest.cc')
-rw-r--r-- | deps/v8/test/unittests/codegen/source-position-table-unittest.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/deps/v8/test/unittests/codegen/source-position-table-unittest.cc b/deps/v8/test/unittests/codegen/source-position-table-unittest.cc index edf554a8ea..6f966255f8 100644 --- a/deps/v8/test/unittests/codegen/source-position-table-unittest.cc +++ b/deps/v8/test/unittests/codegen/source-position-table-unittest.cc @@ -61,7 +61,7 @@ TEST_F(SourcePositionTableTest, EncodeExpression) { CHECK(!builder()->ToSourcePositionTable(isolate()).is_null()); } -TEST_F(SourcePositionTableTest, EncodeAscending) { +TEST_F(SourcePositionTableTest, EncodeAscendingPositive) { int code_offset = 0; int source_position = 0; for (size_t i = 0; i < arraysize(offsets); i++) { @@ -74,7 +74,13 @@ TEST_F(SourcePositionTableTest, EncodeAscending) { } } - // Also test negative offsets for source positions: + CHECK(!builder()->ToSourcePositionTable(isolate()).is_null()); +} + +TEST_F(SourcePositionTableTest, EncodeAscendingNegative) { + int code_offset = 0; + // Start with a big source position, then decrement it. + int source_position = 1 << 26; for (size_t i = 0; i < arraysize(offsets); i++) { code_offset += offsets[i]; source_position -= offsets[i]; |