1c00ec2b94bc5505fa81f81daefd956f5a8776a09danno@chromium.org// Copyright 2013 the V8 project authors. All rights reserved. 2c00ec2b94bc5505fa81f81daefd956f5a8776a09danno@chromium.org// Redistribution and use in source and binary forms, with or without 3c00ec2b94bc5505fa81f81daefd956f5a8776a09danno@chromium.org// modification, are permitted provided that the following conditions are 4c00ec2b94bc5505fa81f81daefd956f5a8776a09danno@chromium.org// met: 5c00ec2b94bc5505fa81f81daefd956f5a8776a09danno@chromium.org// 6c00ec2b94bc5505fa81f81daefd956f5a8776a09danno@chromium.org// * Redistributions of source code must retain the above copyright 7c00ec2b94bc5505fa81f81daefd956f5a8776a09danno@chromium.org// notice, this list of conditions and the following disclaimer. 8c00ec2b94bc5505fa81f81daefd956f5a8776a09danno@chromium.org// * Redistributions in binary form must reproduce the above 9c00ec2b94bc5505fa81f81daefd956f5a8776a09danno@chromium.org// copyright notice, this list of conditions and the following 10c00ec2b94bc5505fa81f81daefd956f5a8776a09danno@chromium.org// disclaimer in the documentation and/or other materials provided 11c00ec2b94bc5505fa81f81daefd956f5a8776a09danno@chromium.org// with the distribution. 12c00ec2b94bc5505fa81f81daefd956f5a8776a09danno@chromium.org// * Neither the name of Google Inc. nor the names of its 13c00ec2b94bc5505fa81f81daefd956f5a8776a09danno@chromium.org// contributors may be used to endorse or promote products derived 14c00ec2b94bc5505fa81f81daefd956f5a8776a09danno@chromium.org// from this software without specific prior written permission. 15c00ec2b94bc5505fa81f81daefd956f5a8776a09danno@chromium.org// 16c00ec2b94bc5505fa81f81daefd956f5a8776a09danno@chromium.org// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17c00ec2b94bc5505fa81f81daefd956f5a8776a09danno@chromium.org// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 18c00ec2b94bc5505fa81f81daefd956f5a8776a09danno@chromium.org// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19c00ec2b94bc5505fa81f81daefd956f5a8776a09danno@chromium.org// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20c00ec2b94bc5505fa81f81daefd956f5a8776a09danno@chromium.org// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21c00ec2b94bc5505fa81f81daefd956f5a8776a09danno@chromium.org// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22c00ec2b94bc5505fa81f81daefd956f5a8776a09danno@chromium.org// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23c00ec2b94bc5505fa81f81daefd956f5a8776a09danno@chromium.org// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24c00ec2b94bc5505fa81f81daefd956f5a8776a09danno@chromium.org// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25c00ec2b94bc5505fa81f81daefd956f5a8776a09danno@chromium.org// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26c00ec2b94bc5505fa81f81daefd956f5a8776a09danno@chromium.org// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27c00ec2b94bc5505fa81f81daefd956f5a8776a09danno@chromium.org 28c00ec2b94bc5505fa81f81daefd956f5a8776a09danno@chromium.org// Flags: --allow-natives-syntax 29c00ec2b94bc5505fa81f81daefd956f5a8776a09danno@chromium.org 30c00ec2b94bc5505fa81f81daefd956f5a8776a09danno@chromium.orgfunction f() { 31c00ec2b94bc5505fa81f81daefd956f5a8776a09danno@chromium.org var end = 1073741823; // 2^30 - 1 32c00ec2b94bc5505fa81f81daefd956f5a8776a09danno@chromium.org var start = end - 100000; // Run long enough to trigger OSR. 33c00ec2b94bc5505fa81f81daefd956f5a8776a09danno@chromium.org for (var i = start; i <= end; ++i) { 34c00ec2b94bc5505fa81f81daefd956f5a8776a09danno@chromium.org assertTrue(i >= start); // No overflow allowed! 35c00ec2b94bc5505fa81f81daefd956f5a8776a09danno@chromium.org } 36c00ec2b94bc5505fa81f81daefd956f5a8776a09danno@chromium.org} 37c00ec2b94bc5505fa81f81daefd956f5a8776a09danno@chromium.org 38c00ec2b94bc5505fa81f81daefd956f5a8776a09danno@chromium.orgf(); 39