Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/intermediate_language.h" | 5 #include "vm/intermediate_language.h" |
| 6 #include "vm/unit_test.h" | 6 #include "vm/unit_test.h" |
| 7 | 7 |
| 8 namespace dart { | 8 namespace dart { |
| 9 | 9 |
| 10 TEST_CASE(InstructionTests) { | 10 TEST_CASE(InstructionTests) { |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 32 use1->RemoveFromUseList(); | 32 use1->RemoveFromUseList(); |
| 33 EXPECT(def1->use_list()->next_use()->next_use() == NULL); | 33 EXPECT(def1->use_list()->next_use()->next_use() == NULL); |
| 34 use3->SetDefinition(def2); | 34 use3->SetDefinition(def2); |
| 35 EXPECT(def1->use_list() == use2); | 35 EXPECT(def1->use_list() == use2); |
| 36 EXPECT(def1->use_list()->next_use() == NULL); | 36 EXPECT(def1->use_list()->next_use() == NULL); |
| 37 EXPECT(def2->use_list() == use3); | 37 EXPECT(def2->use_list() == use3); |
| 38 EXPECT(def2->use_list()->next_use() == NULL); | 38 EXPECT(def2->use_list()->next_use() == NULL); |
| 39 BindInstr* bind = new BindInstr(BindInstr::kUsed, use2); | 39 BindInstr* bind = new BindInstr(BindInstr::kUsed, use2); |
| 40 bind->RemoveInputUses(); | 40 bind->RemoveInputUses(); |
| 41 EXPECT(def1->use_list() == NULL); | 41 EXPECT(def1->use_list() == NULL); |
| 42 // Test replacing with a definition without uses. | |
| 43 UseVal* use4 = new UseVal(def2); | |
| 44 def2->ReplaceUsesWith(def1); | |
| 45 EXPECT(def1->use_list() == use4); | |
|
zerny-google
2012/08/14 11:04:36
Maybe check a few more properties here:
EXPECT(de
Florian Schneider
2012/08/14 11:17:17
Done. Good point. I forgot to set the uselist of d
| |
| 42 } | 46 } |
| 43 | 47 |
| 44 } // namespace dart | 48 } // namespace dart |
| OLD | NEW |