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

Unified Diff: test/cctest/compiler/codegen-tester.cc

Issue 1423133005: Implemented the BufferedRawMachineAssemblerTester. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Adjustments to codebase changes. Created 5 years, 2 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
Index: test/cctest/compiler/codegen-tester.cc
diff --git a/test/cctest/compiler/codegen-tester.cc b/test/cctest/compiler/codegen-tester.cc
index ed5ff094fd6707e8141b6168f21ae06867814dfd..4facf34de2d7509a258785defc761046af10ed06 100644
--- a/test/cctest/compiler/codegen-tester.cc
+++ b/test/cctest/compiler/codegen-tester.cc
@@ -568,3 +568,94 @@ TEST(RunBinopTester) {
FOR_FLOAT64_INPUTS(i) { CheckDoubleEq(*i, bt.call(-11.25, *i)); }
}
}
+
+
+#if V8_TARGET_ARCH_64_BIT
+// TODO(ahaas): run int64 tests on all platforms when supported.
+TEST(RunBufferedRawMachineAssemblerTesterTester) {
+ {
+ BufferedRawMachineAssemblerTester<int64_t> m;
+ m.Return(m.Int64Constant(0x12500000000));
+ CHECK_EQ(0x12500000000, m.Call());
+ }
+ {
+ BufferedRawMachineAssemblerTester<double> m(kMachFloat64);
+ m.Return(m.Parameter(0));
+ CHECK_EQ(1.25, m.Call(1.25));
+ }
+ {
+ BufferedRawMachineAssemblerTester<int64_t> m(kMachInt64, kMachInt64);
+ m.Return(m.Int64Add(m.Parameter(0), m.Parameter(1)));
+ CHECK_EQ(0x300000000, m.Call(0x100000000, 0x200000000));
+ }
+ {
+ BufferedRawMachineAssemblerTester<int64_t> m(kMachInt64, kMachInt64,
+ kMachInt64);
+ m.Return(
+ m.Int64Add(m.Int64Add(m.Parameter(0), m.Parameter(1)), m.Parameter(2)));
+ CHECK_EQ(0x600000000, m.Call(0x100000000, 0x200000000, 0x300000000));
titzer 2015/10/30 19:48:52 Probably want to check some real 64-bit numbers he
ahaas 2015/10/30 21:13:09 Done.
+ }
+ {
+ BufferedRawMachineAssemblerTester<int64_t> m(kMachInt64, kMachInt64,
+ kMachInt64, kMachInt64);
+ m.Return(m.Int64Add(
+ m.Int64Add(m.Int64Add(m.Parameter(0), m.Parameter(1)), m.Parameter(2)),
+ m.Parameter(3)));
+ CHECK_EQ(0xa00000000,
+ m.Call(0x100000000, 0x200000000, 0x300000000, 0x400000000));
+ }
+ {
+ BufferedRawMachineAssemblerTester<void> m;
+ int64_t result;
+ m.Store(MachineTypeForC<int64_t>(), m.PointerConstant(&result),
+ m.Int64Constant(0x12500000000), kNoWriteBarrier);
+ m.Return(m.Int32Constant(0));
+ m.Call();
+ CHECK_EQ(0x12500000000, result);
+ }
+ {
+ BufferedRawMachineAssemblerTester<void> m(kMachFloat64);
+ double result;
+ m.Store(MachineTypeForC<double>(), m.PointerConstant(&result),
+ m.Parameter(0), kNoWriteBarrier);
+ m.Return(m.Int32Constant(0));
+ m.Call(1.25);
+ CHECK_EQ(1.25, result);
+ }
+ {
+ BufferedRawMachineAssemblerTester<void> m(kMachInt64, kMachInt64);
+ int64_t result;
+ m.Store(MachineTypeForC<int64_t>(), m.PointerConstant(&result),
+ m.Int64Add(m.Parameter(0), m.Parameter(1)), kNoWriteBarrier);
+ m.Return(m.Int32Constant(0));
+ m.Call(0x100000000, 0x200000000);
+ CHECK_EQ(0x300000000, result);
+ }
+ {
+ BufferedRawMachineAssemblerTester<void> m(kMachInt64, kMachInt64,
+ kMachInt64);
+ int64_t result;
+ m.Store(
+ MachineTypeForC<int64_t>(), m.PointerConstant(&result),
+ m.Int64Add(m.Int64Add(m.Parameter(0), m.Parameter(1)), m.Parameter(2)),
+ kNoWriteBarrier);
+ m.Return(m.Int32Constant(0));
+ m.Call(0x100000000, 0x200000000, 0x300000000);
+ CHECK_EQ(0x600000000, result);
+ }
+ {
+ BufferedRawMachineAssemblerTester<void> m(kMachInt64, kMachInt64,
+ kMachInt64, kMachInt64);
+ int64_t result;
+ m.Store(MachineTypeForC<int64_t>(), m.PointerConstant(&result),
+ m.Int64Add(m.Int64Add(m.Int64Add(m.Parameter(0), m.Parameter(1)),
+ m.Parameter(2)),
+ m.Parameter(3)),
+ kNoWriteBarrier);
+ m.Return(m.Int32Constant(0));
+ m.Call(0x100000000, 0x200000000, 0x300000000, 0x400000000);
+ CHECK_EQ(0xa00000000, result);
+ }
+}
+
+#endif
« test/cctest/compiler/codegen-tester.h ('K') | « test/cctest/compiler/codegen-tester.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698