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

Unified Diff: runtime/vm/compiler_test.cc

Issue 2481873005: clang-format runtime/vm (Closed)
Patch Set: Merge Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/compiler_stats.cc ('k') | runtime/vm/constant_propagator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/compiler_test.cc
diff --git a/runtime/vm/compiler_test.cc b/runtime/vm/compiler_test.cc
index f2e138cf0f06dc73bf69f101f1c5e2c8fa052ada..5225c53a9cc2fb7a42e752d40f12075fe0d3005c 100644
--- a/runtime/vm/compiler_test.cc
+++ b/runtime/vm/compiler_test.cc
@@ -22,9 +22,8 @@ VM_TEST_CASE(CompileScript) {
"}\n";
String& url = String::Handle(String::New("dart-test:CompileScript"));
String& source = String::Handle(String::New(kScriptChars));
- Script& script = Script::Handle(Script::New(url,
- source,
- RawScript::kScriptTag));
+ Script& script =
+ Script::Handle(Script::New(url, source, RawScript::kScriptTag));
Library& lib = Library::Handle(Library::CoreLibrary());
EXPECT(CompilerTest::TestCompileScript(lib, script));
}
@@ -32,22 +31,21 @@ VM_TEST_CASE(CompileScript) {
VM_TEST_CASE(CompileFunction) {
const char* kScriptChars =
- "class A {\n"
- " static foo() { return 42; }\n"
- " static moo() {\n"
- " // A.foo();\n"
- " }\n"
- "}\n";
+ "class A {\n"
+ " static foo() { return 42; }\n"
+ " static moo() {\n"
+ " // A.foo();\n"
+ " }\n"
+ "}\n";
String& url = String::Handle(String::New("dart-test:CompileFunction"));
String& source = String::Handle(String::New(kScriptChars));
- Script& script = Script::Handle(Script::New(url,
- source,
- RawScript::kScriptTag));
+ Script& script =
+ Script::Handle(Script::New(url, source, RawScript::kScriptTag));
Library& lib = Library::Handle(Library::CoreLibrary());
EXPECT(CompilerTest::TestCompileScript(lib, script));
EXPECT(ClassFinalizer::ProcessPendingClasses());
- Class& cls = Class::Handle(
- lib.LookupClass(String::Handle(Symbols::New(thread, "A"))));
+ Class& cls =
+ Class::Handle(lib.LookupClass(String::Handle(Symbols::New(thread, "A"))));
EXPECT(!cls.IsNull());
String& function_foo_name = String::Handle(String::New("foo"));
Function& function_foo =
@@ -74,20 +72,19 @@ VM_TEST_CASE(CompileFunction) {
VM_TEST_CASE(CompileFunctionOnHelperThread) {
// Create a simple function and compile it without optimization.
const char* kScriptChars =
- "class A {\n"
- " static foo() { return 42; }\n"
- "}\n";
+ "class A {\n"
+ " static foo() { return 42; }\n"
+ "}\n";
String& url =
String::Handle(String::New("dart-test:CompileFunctionOnHelperThread"));
String& source = String::Handle(String::New(kScriptChars));
- Script& script = Script::Handle(Script::New(url,
- source,
- RawScript::kScriptTag));
+ Script& script =
+ Script::Handle(Script::New(url, source, RawScript::kScriptTag));
Library& lib = Library::Handle(Library::CoreLibrary());
EXPECT(CompilerTest::TestCompileScript(lib, script));
EXPECT(ClassFinalizer::ProcessPendingClasses());
- Class& cls = Class::Handle(
- lib.LookupClass(String::Handle(Symbols::New(thread, "A"))));
+ Class& cls =
+ Class::Handle(lib.LookupClass(String::Handle(Symbols::New(thread, "A"))));
EXPECT(!cls.IsNull());
String& function_foo_name = String::Handle(String::New("foo"));
Function& func =
@@ -115,13 +112,13 @@ VM_TEST_CASE(CompileFunctionOnHelperThread) {
TEST_CASE(RegenerateAllocStubs) {
const char* kScriptChars =
- "class A {\n"
- "}\n"
- "unOpt() => new A(); \n"
- "optIt() => new A(); \n"
- "A main() {\n"
- " return unOpt();\n"
- "}\n";
+ "class A {\n"
+ "}\n"
+ "unOpt() => new A(); \n"
+ "optIt() => new A(); \n"
+ "A main() {\n"
+ " return unOpt();\n"
+ "}\n";
Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL);
Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL);
@@ -133,8 +130,8 @@ TEST_CASE(RegenerateAllocStubs) {
EXPECT(!cls.IsNull());
Zone* zone = thread->zone();
- const Code& stub = Code::Handle(zone,
- StubCode::GetAllocationStubForClass(cls));
+ const Code& stub =
+ Code::Handle(zone, StubCode::GetAllocationStubForClass(cls));
Class& owner = Class::Handle();
owner ^= stub.owner();
owner.DisableAllocationStub();
@@ -163,7 +160,7 @@ TEST_CASE(EvalExpression) {
Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL);
Dart_Handle obj_handle =
- Dart_Invoke(lib, Dart_NewStringFromCString("makeObj"), 0, NULL);
+ Dart_Invoke(lib, Dart_NewStringFromCString("makeObj"), 0, NULL);
EXPECT(!Dart_IsNull(obj_handle));
EXPECT(!Dart_IsError(obj_handle));
TransitionNativeToVM transition(thread);
@@ -175,10 +172,8 @@ TEST_CASE(EvalExpression) {
expr_text = String::New("apa + ' ${calc(10)}' + dot");
Object& val = Object::Handle();
const Class& receiver_cls = Class::Handle(obj.clazz());
- val = Instance::Cast(obj).Evaluate(receiver_cls,
- expr_text,
- Array::empty_array(),
- Array::empty_array());
+ val = Instance::Cast(obj).Evaluate(
+ receiver_cls, expr_text, Array::empty_array(), Array::empty_array());
EXPECT(!val.IsNull());
EXPECT(!val.IsError());
EXPECT(val.IsString());
@@ -189,8 +184,8 @@ TEST_CASE(EvalExpression) {
VM_TEST_CASE(EvalExpressionWithLazyCompile) {
Library& lib = Library::Handle(Library::CoreLibrary());
- const String& expression = String::Handle(String::New(
- "(){ return (){ return (){ return 3 + 4; }(); }(); }()"));
+ const String& expression = String::Handle(
+ String::New("(){ return (){ return (){ return 3 + 4; }(); }(); }()"));
Object& val = Object::Handle();
val = lib.Evaluate(expression, Array::empty_array(), Array::empty_array());
« no previous file with comments | « runtime/vm/compiler_stats.cc ('k') | runtime/vm/constant_propagator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698