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

Side by Side Diff: test/unittests/compiler/live-range-unittest.cc

Issue 1384733002: [test] Protect against infinite loops in LiveRange logic. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: disable tests in release mode Created 5 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 5
6 #include "test/unittests/compiler/live-range-builder.h" 6 #include "test/unittests/compiler/live-range-builder.h"
7 #include "test/unittests/test-utils.h" 7 #include "test/unittests/test-utils.h"
8 8
9 9
10 // TODO(mtrofin): would we want to centralize this definition? 10 // TODO(mtrofin): would we want to centralize this definition?
11 #ifdef DEBUG 11 #ifdef DEBUG
12 #define V8_ASSERT_DEBUG_DEATH(statement, regex) \ 12 #define V8_ASSERT_DEBUG_DEATH(statement, regex) \
13 ASSERT_DEATH_IF_SUPPORTED(statement, regex) 13 ASSERT_DEATH_IF_SUPPORTED(statement, regex)
14 #define DISABLE_IN_RELEASE(Name) Name
14 15
15 #else 16 #else
16 #define V8_ASSERT_DEBUG_DEATH(statement, regex) statement 17 #define V8_ASSERT_DEBUG_DEATH(statement, regex) statement
18 #define DISABLE_IN_RELEASE(Name) DISABLED_##Name
17 #endif // DEBUG 19 #endif // DEBUG
18 20
19 namespace v8 { 21 namespace v8 {
20 namespace internal { 22 namespace internal {
21 namespace compiler { 23 namespace compiler {
22 24
23 class LiveRangeUnitTest : public TestWithZone { 25 class LiveRangeUnitTest : public TestWithZone {
24 public: 26 public:
25 // Split helper, to avoid int->LifetimePosition conversion nuisance. 27 // Split helper, to avoid int->LifetimePosition conversion nuisance.
26 LiveRange* Split(LiveRange* range, int pos) { 28 LiveRange* Split(LiveRange* range, int pos) {
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 ".*"); 78 ".*");
77 } 79 }
78 80
79 81
80 TEST_F(LiveRangeUnitTest, SplitInvalidStart) { 82 TEST_F(LiveRangeUnitTest, SplitInvalidStart) {
81 TopLevelLiveRange* range = TestRangeBuilder(zone()).Build(0, 1); 83 TopLevelLiveRange* range = TestRangeBuilder(zone()).Build(0, 1);
82 V8_ASSERT_DEBUG_DEATH(Split(range, 0), ".*"); 84 V8_ASSERT_DEBUG_DEATH(Split(range, 0), ".*");
83 } 85 }
84 86
85 87
86 TEST_F(LiveRangeUnitTest, InvalidSplitEnd) { 88 TEST_F(LiveRangeUnitTest, DISABLE_IN_RELEASE(InvalidSplitEnd)) {
87 TopLevelLiveRange* range = TestRangeBuilder(zone()).Build(0, 1); 89 TopLevelLiveRange* range = TestRangeBuilder(zone()).Build(0, 1);
88 ASSERT_DEATH_IF_SUPPORTED(Split(range, 1), ".*"); 90 ASSERT_DEATH_IF_SUPPORTED(Split(range, 1), ".*");
89 } 91 }
90 92
91 93
92 TEST_F(LiveRangeUnitTest, SplitInvalidPreStart) { 94 TEST_F(LiveRangeUnitTest, DISABLE_IN_RELEASE(SplitInvalidPreStart)) {
93 TopLevelLiveRange* range = TestRangeBuilder(zone()).Build(1, 2); 95 TopLevelLiveRange* range = TestRangeBuilder(zone()).Build(1, 2);
94 ASSERT_DEATH_IF_SUPPORTED(Split(range, 0), ".*"); 96 ASSERT_DEATH_IF_SUPPORTED(Split(range, 0), ".*");
95 } 97 }
96 98
97 99
98 TEST_F(LiveRangeUnitTest, SplitInvalidPostEnd) { 100 TEST_F(LiveRangeUnitTest, DISABLE_IN_RELEASE(SplitInvalidPostEnd)) {
99 TopLevelLiveRange* range = TestRangeBuilder(zone()).Build(0, 1); 101 TopLevelLiveRange* range = TestRangeBuilder(zone()).Build(0, 1);
100 ASSERT_DEATH_IF_SUPPORTED(Split(range, 2), ".*"); 102 ASSERT_DEATH_IF_SUPPORTED(Split(range, 2), ".*");
101 } 103 }
102 104
103 105
104 TEST_F(LiveRangeUnitTest, SplitSingleIntervalNoUsePositions) { 106 TEST_F(LiveRangeUnitTest, SplitSingleIntervalNoUsePositions) {
105 TopLevelLiveRange* range = TestRangeBuilder(zone()).Build(0, 2); 107 TopLevelLiveRange* range = TestRangeBuilder(zone()).Build(0, 2);
106 LiveRange* child = Split(range, 1); 108 LiveRange* child = Split(range, 1);
107 109
108 EXPECT_NE(nullptr, range->next()); 110 EXPECT_NE(nullptr, range->next());
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 EXPECT_EQ(1, splinter->relative_id()); 432 EXPECT_EQ(1, splinter->relative_id());
431 EXPECT_EQ(3, splinter_child->relative_id()); 433 EXPECT_EQ(3, splinter_child->relative_id());
432 434
433 vreg->Merge(splinter, zone()); 435 vreg->Merge(splinter, zone());
434 EXPECT_EQ(1, splinter->relative_id()); 436 EXPECT_EQ(1, splinter->relative_id());
435 } 437 }
436 438
437 } // namespace compiler 439 } // namespace compiler
438 } // namespace internal 440 } // namespace internal
439 } // namespace v8 441 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698