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

Unified Diff: test/mjsunit/bugs/bug-2758.js

Issue 148503002: A64: Synchronize with r15545. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 11 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 | « test/mjsunit/array-feedback.js ('k') | test/mjsunit/date.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/bugs/bug-2758.js
diff --git a/test/mjsunit/regress/regress-int32-truncation.js b/test/mjsunit/bugs/bug-2758.js
similarity index 78%
copy from test/mjsunit/regress/regress-int32-truncation.js
copy to test/mjsunit/bugs/bug-2758.js
index dec4ac1195a6c4928d84eac8cc8dc9496bf66600..ee78844400031a8d8892011eb8621b978cf6513e 100644
--- a/test/mjsunit/regress/regress-int32-truncation.js
+++ b/test/mjsunit/bugs/bug-2758.js
@@ -27,35 +27,23 @@
// Flags: --allow-natives-syntax
-function f(i, b) {
- var a = 0;
- if (b) {
- var c = 1 << i;
- a = c + c;
- }
- var x = a >> 3;
- return a;
-}
-
-f(1, false);
-f(1, true);
-%OptimizeFunctionOnNextCall(f);
-assertEquals((1 << 30) * 2, f(30, true));
+var functions = [
+ function() { var f = [].concat; f() },
+ function() { var f = [].push; f() },
+ function() { var f = [].shift; f() },
+ function() { (0, [].concat)() },
+ function() { (0, [].push)() },
+ function() { (0, [].shift)() }
+]
+for (var i = 0; i < 5; ++i) {
+ for (var j in functions) {
+ print(functions[i])
+ assertThrows(functions[j], TypeError)
+ }
-var global = 1;
-
-function f2(b) {
- var a = 0;
- if (b) {
- a = global;
+ if (i === 3) {
+ for (var j in functions)
+ %OptimizeFunctionOnNextCall(functions[j]);
}
- var x = a >> 3;
- return a;
}
-
-f2(false);
-f2(true);
-%OptimizeFunctionOnNextCall(f2);
-global = 2.5;
-assertEquals(global, f2(true));
« no previous file with comments | « test/mjsunit/array-feedback.js ('k') | test/mjsunit/date.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698