| 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 "platform/globals.h" | 5 #include "platform/globals.h" |
| 6 | 6 |
| 7 #include "platform/assert.h" | 7 #include "platform/assert.h" |
| 8 #include "vm/globals.h" | 8 #include "vm/globals.h" |
| 9 #include "vm/ast.h" | 9 #include "vm/ast.h" |
| 10 #include "vm/assembler.h" | 10 #include "vm/assembler.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 namespace dart { | 21 namespace dart { |
| 22 | 22 |
| 23 static const intptr_t kPos = Scanner::kNoSourcePos; | 23 static const intptr_t kPos = Scanner::kNoSourcePos; |
| 24 | 24 |
| 25 | 25 |
| 26 CODEGEN_TEST_GENERATE(SimpleReturnCodegen, test) { | 26 CODEGEN_TEST_GENERATE(SimpleReturnCodegen, test) { |
| 27 test->node_sequence()->Add(new ReturnNode(kPos)); | 27 test->node_sequence()->Add(new ReturnNode(kPos)); |
| 28 } | 28 } |
| 29 CODEGEN_TEST_RUN(SimpleReturnCodegen, Instance::null()) | 29 CODEGEN_TEST_RUN(SimpleReturnCodegen, Instance::null()) |
| 30 | 30 |
| 31 // TODO(zra): Remove when tests are ready to enable. | |
| 32 #if !defined(TARGET_ARCH_ARM64) | |
| 33 | 31 |
| 34 CODEGEN_TEST_GENERATE(SmiReturnCodegen, test) { | 32 CODEGEN_TEST_GENERATE(SmiReturnCodegen, test) { |
| 35 LiteralNode* l = new LiteralNode(kPos, Smi::ZoneHandle(Smi::New(3))); | 33 LiteralNode* l = new LiteralNode(kPos, Smi::ZoneHandle(Smi::New(3))); |
| 36 test->node_sequence()->Add(new ReturnNode(kPos, l)); | 34 test->node_sequence()->Add(new ReturnNode(kPos, l)); |
| 37 } | 35 } |
| 38 CODEGEN_TEST_RUN(SmiReturnCodegen, Smi::New(3)) | 36 CODEGEN_TEST_RUN(SmiReturnCodegen, Smi::New(3)) |
| 39 | 37 |
| 40 | 38 |
| 41 CODEGEN_TEST2_GENERATE(SimpleStaticCallCodegen, function, test) { | 39 CODEGEN_TEST2_GENERATE(SimpleStaticCallCodegen, function, test) { |
| 42 // Wrap the SmiReturnCodegen test above as a static function and call it. | 40 // Wrap the SmiReturnCodegen test above as a static function and call it. |
| 43 ArgumentListNode* no_arguments = new ArgumentListNode(kPos); | 41 ArgumentListNode* no_arguments = new ArgumentListNode(kPos); |
| 44 test->node_sequence()->Add( | 42 test->node_sequence()->Add( |
| 45 new ReturnNode(kPos, new StaticCallNode(kPos, function, no_arguments))); | 43 new ReturnNode(kPos, new StaticCallNode(kPos, function, no_arguments))); |
| 46 } | 44 } |
| 47 CODEGEN_TEST2_RUN(SimpleStaticCallCodegen, SmiReturnCodegen, Smi::New(3)) | 45 CODEGEN_TEST2_RUN(SimpleStaticCallCodegen, SmiReturnCodegen, Smi::New(3)) |
| 48 | 46 |
| 49 | 47 |
| 48 // TODO(zra): Remove when tests are ready to enable. |
| 49 #if !defined(TARGET_ARCH_ARM64) |
| 50 |
| 50 // Helper to allocate and return a LocalVariable. | 51 // Helper to allocate and return a LocalVariable. |
| 51 static LocalVariable* NewTestLocalVariable(const char* name) { | 52 static LocalVariable* NewTestLocalVariable(const char* name) { |
| 52 const String& variable_name = String::ZoneHandle(Symbols::New(name)); | 53 const String& variable_name = String::ZoneHandle(Symbols::New(name)); |
| 53 const Type& variable_type = Type::ZoneHandle(Type::DynamicType()); | 54 const Type& variable_type = Type::ZoneHandle(Type::DynamicType()); |
| 54 return new LocalVariable(kPos, variable_name, variable_type); | 55 return new LocalVariable(kPos, variable_name, variable_type); |
| 55 } | 56 } |
| 56 | 57 |
| 57 | 58 |
| 58 CODEGEN_TEST_GENERATE(ReturnParameterCodegen, test) { | 59 CODEGEN_TEST_GENERATE(ReturnParameterCodegen, test) { |
| 59 SequenceNode* node_seq = test->node_sequence(); | 60 SequenceNode* node_seq = test->node_sequence(); |
| (...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 565 app_lib ^= libs.At(num_libs - 1); | 566 app_lib ^= libs.At(num_libs - 1); |
| 566 ASSERT(!app_lib.IsNull()); | 567 ASSERT(!app_lib.IsNull()); |
| 567 const Class& cls = Class::Handle( | 568 const Class& cls = Class::Handle( |
| 568 app_lib.LookupClass(String::Handle(Symbols::New("A")))); | 569 app_lib.LookupClass(String::Handle(Symbols::New("A")))); |
| 569 EXPECT_EQ(cls.raw(), result.clazz()); | 570 EXPECT_EQ(cls.raw(), result.clazz()); |
| 570 } | 571 } |
| 571 | 572 |
| 572 #endif // !defined(TARGET_ARCH_ARM64) | 573 #endif // !defined(TARGET_ARCH_ARM64) |
| 573 | 574 |
| 574 } // namespace dart | 575 } // namespace dart |
| OLD | NEW |