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

Side by Side Diff: test/cctest/compiler/test-typer.cc

Issue 658743002: Refine typing of addition, subtraction, multiplication, and division. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rangify (unions of) constants to get monotonicity. Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/types.h ('k') | test/cctest/test-types.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 5
6 // This tests the correctness of the typer. 6 // This tests the correctness of the typer.
7 // 7 //
8 // For simplicity, it currently only tests it on expression operators that have 8 // For simplicity, it currently only tests it on expression operators that have
9 // a direct equivalent in C++. Also, testing is currently limited to ranges as 9 // a direct equivalent in C++. Also, testing is currently limited to ranges as
10 // input types. 10 // input types.
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 165
166 static int32_t shift_left(int32_t x, int32_t y) { return x << y; } 166 static int32_t shift_left(int32_t x, int32_t y) { return x << y; }
167 static int32_t shift_right(int32_t x, int32_t y) { return x >> y; } 167 static int32_t shift_right(int32_t x, int32_t y) { return x >> y; }
168 static int32_t bit_or(int32_t x, int32_t y) { return x | y; } 168 static int32_t bit_or(int32_t x, int32_t y) { return x | y; }
169 static int32_t bit_and(int32_t x, int32_t y) { return x & y; } 169 static int32_t bit_and(int32_t x, int32_t y) { return x & y; }
170 static int32_t bit_xor(int32_t x, int32_t y) { return x ^ y; } 170 static int32_t bit_xor(int32_t x, int32_t y) { return x ^ y; }
171 171
172 172
173 TEST(TypeJSAdd) { 173 TEST(TypeJSAdd) {
174 TyperTester t; 174 TyperTester t;
175 t.TestBinaryArithOp(t.javascript_.Subtract(), std::plus<double>()); 175 t.TestBinaryArithOp(t.javascript_.Add(), std::plus<double>());
176 } 176 }
177 177
178 178
179 TEST(TypeJSSubtract) { 179 TEST(TypeJSSubtract) {
180 TyperTester t; 180 TyperTester t;
181 t.TestBinaryArithOp(t.javascript_.Subtract(), std::minus<double>()); 181 t.TestBinaryArithOp(t.javascript_.Subtract(), std::minus<double>());
182 } 182 }
183 183
184 184
185 TEST(TypeJSMultiply) { 185 TEST(TypeJSMultiply) {
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 TyperTester t; 267 TyperTester t;
268 t.TestBinaryCompareOp(t.javascript_.StrictEqual(), std::equal_to<double>()); 268 t.TestBinaryCompareOp(t.javascript_.StrictEqual(), std::equal_to<double>());
269 } 269 }
270 270
271 271
272 TEST(TypeJSStrictNotEqual) { 272 TEST(TypeJSStrictNotEqual) {
273 TyperTester t; 273 TyperTester t;
274 t.TestBinaryCompareOp( 274 t.TestBinaryCompareOp(
275 t.javascript_.StrictNotEqual(), std::not_equal_to<double>()); 275 t.javascript_.StrictNotEqual(), std::not_equal_to<double>());
276 } 276 }
OLDNEW
« no previous file with comments | « src/types.h ('k') | test/cctest/test-types.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698