OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <functional> | 5 #include <functional> |
6 | 6 |
7 #include "src/compiler/node-properties-inl.h" | 7 #include "src/compiler/node-properties-inl.h" |
8 #include "src/compiler/typer.h" | 8 #include "src/compiler/typer.h" |
9 #include "test/cctest/cctest.h" | 9 #include "test/cctest/cctest.h" |
10 #include "test/cctest/compiler/graph-builder-tester.h" | 10 #include "test/cctest/compiler/graph-builder-tester.h" |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 | 187 |
188 //------------------------------------------------------------------------------ | 188 //------------------------------------------------------------------------------ |
189 // Soundness | 189 // Soundness |
190 // For simplicity, we currently only test soundness on expression operators | 190 // For simplicity, we currently only test soundness on expression operators |
191 // that have a direct equivalent in C++. Also, testing is currently limited | 191 // that have a direct equivalent in C++. Also, testing is currently limited |
192 // to ranges as input types. | 192 // to ranges as input types. |
193 | 193 |
194 | 194 |
195 TEST(TypeJSAdd) { | 195 TEST(TypeJSAdd) { |
196 TyperTester t; | 196 TyperTester t; |
197 t.TestBinaryArithOp(t.javascript_.Subtract(), std::plus<double>()); | 197 t.TestBinaryArithOp(t.javascript_.Add(), std::plus<double>()); |
198 } | 198 } |
199 | 199 |
200 | 200 |
201 TEST(TypeJSSubtract) { | 201 TEST(TypeJSSubtract) { |
202 TyperTester t; | 202 TyperTester t; |
203 t.TestBinaryArithOp(t.javascript_.Subtract(), std::minus<double>()); | 203 t.TestBinaryArithOp(t.javascript_.Subtract(), std::minus<double>()); |
204 } | 204 } |
205 | 205 |
206 | 206 |
207 TEST(TypeJSMultiply) { | 207 TEST(TypeJSMultiply) { |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 V(Modulus) | 325 V(Modulus) |
326 | 326 |
327 | 327 |
328 TEST(Monotonicity) { | 328 TEST(Monotonicity) { |
329 TyperTester t; | 329 TyperTester t; |
330 #define TEST_OP(name) \ | 330 #define TEST_OP(name) \ |
331 t.TestBinaryMonotonicity(t.javascript_.name()); | 331 t.TestBinaryMonotonicity(t.javascript_.name()); |
332 JSBINOP_LIST(TEST_OP) | 332 JSBINOP_LIST(TEST_OP) |
333 #undef TEST_OP | 333 #undef TEST_OP |
334 } | 334 } |
OLD | NEW |