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

Unified Diff: test/cctest/test-code-stub-assembler.cc

Issue 2825393003: [sim] Consistent support for C calls with up to 9 args (Closed)
Patch Set: enum -> const variable Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/x64/macro-assembler-x64.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-code-stub-assembler.cc
diff --git a/test/cctest/test-code-stub-assembler.cc b/test/cctest/test-code-stub-assembler.cc
index b8f1ccc19eb0ad93516982a7afe61588f4265c4f..4af612f21239c50d6aa0d6bcc2e49f107b7e094a 100644
--- a/test/cctest/test-code-stub-assembler.cc
+++ b/test/cctest/test-code-stub-assembler.cc
@@ -28,6 +28,45 @@ using compiler::CodeAssemblerVariableList;
namespace {
+int sum9(int a0, int a1, int a2, int a3, int a4, int a5, int a6, int a7,
+ int a8) {
+ return a0 + a1 + a2 + a3 + a4 + a5 + a6 + a7 + a8;
+}
+
+} // namespace
+
+TEST(CallCFunction9) {
+ Isolate* isolate(CcTest::InitIsolateOnce());
+
+ const int kNumParams = 0;
+ CodeAssemblerTester data(isolate, kNumParams);
+ CodeStubAssembler m(data.state());
+
+ {
+ Node* const fun_constant = m.ExternalConstant(
+ ExternalReference(reinterpret_cast<Address>(sum9), isolate));
+
+ MachineType type_intptr = MachineType::IntPtr();
+
+ Node* const result = m.CallCFunction9(
+ type_intptr, type_intptr, type_intptr, type_intptr, type_intptr,
+ type_intptr, type_intptr, type_intptr, type_intptr, type_intptr,
+ fun_constant, m.IntPtrConstant(0), m.IntPtrConstant(1),
+ m.IntPtrConstant(2), m.IntPtrConstant(3), m.IntPtrConstant(4),
+ m.IntPtrConstant(5), m.IntPtrConstant(6), m.IntPtrConstant(7),
+ m.IntPtrConstant(8));
+ m.Return(m.SmiTag(result));
+ }
+
+ Handle<Code> code = data.GenerateCode();
+ FunctionTester ft(code, kNumParams);
+
+ Handle<Object> result = ft.Call().ToHandleChecked();
+ CHECK_EQ(36, Handle<Smi>::cast(result)->value());
+}
+
+namespace {
+
void CheckToUint32Result(uint32_t expected, Handle<Object> result) {
const int64_t result_int64 = NumberToInt64(*result);
const uint32_t result_uint32 = NumberToUint32(*result);
« no previous file with comments | « src/x64/macro-assembler-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698