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/assert.h" | 5 #include "platform/assert.h" |
6 #include "vm/globals.h" | 6 #include "vm/globals.h" |
7 #include "vm/heap.h" | 7 #include "vm/heap.h" |
8 #include "vm/unit_test.h" | 8 #include "vm/unit_test.h" |
9 | 9 |
10 namespace dart { | 10 namespace dart { |
11 | 11 |
12 // Only ia32 and x64 can run execution tests. | 12 #if defined(TARGET_ARCH_IA32) || \ |
13 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) | 13 defined(TARGET_ARCH_X64) || \ |
| 14 defined(TARGET_ARCH_ARM) |
| 15 |
14 TEST_CASE(OldGC) { | 16 TEST_CASE(OldGC) { |
15 const char* kScriptChars = | 17 const char* kScriptChars = |
16 "main() {\n" | 18 "main() {\n" |
17 " return [1, 2, 3];\n" | 19 " return [1, 2, 3];\n" |
18 "}\n"; | 20 "}\n"; |
19 FLAG_verbose_gc = true; | 21 FLAG_verbose_gc = true; |
20 Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL); | 22 Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL); |
21 Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL); | 23 Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL); |
22 | 24 |
23 EXPECT_VALID(result); | 25 EXPECT_VALID(result); |
(...skipping 18 matching lines...) Expand all Loading... |
42 EXPECT_VALID(result); | 44 EXPECT_VALID(result); |
43 EXPECT(!Dart_IsNull(result)); | 45 EXPECT(!Dart_IsNull(result)); |
44 EXPECT(Dart_IsList(result)); | 46 EXPECT(Dart_IsList(result)); |
45 Isolate* isolate = Isolate::Current(); | 47 Isolate* isolate = Isolate::Current(); |
46 Heap* heap = isolate->heap(); | 48 Heap* heap = isolate->heap(); |
47 heap->CollectGarbage(Heap::kOld); | 49 heap->CollectGarbage(Heap::kOld); |
48 Dart_ExitScope(); | 50 Dart_ExitScope(); |
49 heap->CollectGarbage(Heap::kOld); | 51 heap->CollectGarbage(Heap::kOld); |
50 } | 52 } |
51 | 53 |
52 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). | 54 #endif // TARGET_ARCH_IA32 || TARGET_ARCH_X64 || TARGET_ARCH_ARM |
53 } | 55 } |
OLD | NEW |