1# Copyright 2013 the V8 project authors. All rights reserved.
2# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
3#
4# Redistribution and use in source and binary forms, with or without
5# modification, are permitted provided that the following conditions
6# are met:
7# 1.  Redistributions of source code must retain the above copyright
8#     notice, this list of conditions and the following disclaimer.
9# 2.  Redistributions in binary form must reproduce the above copyright
10#     notice, this list of conditions and the following disclaimer in the
11#     documentation and/or other materials provided with the distribution.
12#
13# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
14# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
16# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
17# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
18# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
19# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
22# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23
24Tests that our optimization to elide overflow checks understands that if we keep adding huge numbers, we could end up creating a number that is not precisely representable using doubles.
25
26On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
27
28
29PASS foo(2147483647) is 2147483552
30PASS foo(2147483647) is 2147483552
31PASS foo(2147483647) is 2147483552
32PASS foo(2147483647) is 2147483552
33PASS foo(2147483647) is 2147483552
34PASS foo(2147483647) is 2147483552
35PASS foo(2147483647) is 2147483552
36PASS foo(2147483647) is 2147483552
37PASS foo(2147483647) is 2147483552
38PASS foo(2147483647) is 2147483552
39PASS foo(2147483647) is 2147483552
40PASS foo(2147483647) is 2147483552
41PASS foo(2147483647) is 2147483552
42PASS foo(2147483647) is 2147483552
43PASS foo(2147483647) is 2147483552
44PASS foo(2147483647) is 2147483552
45PASS foo(2147483647) is 2147483552
46PASS foo(2147483647) is 2147483552
47PASS foo(2147483647) is 2147483552
48PASS foo(2147483647) is 2147483552
49PASS foo(2147483647) is 2147483552
50PASS foo(2147483647) is 2147483552
51PASS foo(2147483647) is 2147483552
52PASS foo(2147483647) is 2147483552
53PASS foo(2147483647) is 2147483552
54PASS foo(2147483647) is 2147483552
55PASS foo(2147483647) is 2147483552
56PASS foo(2147483647) is 2147483552
57PASS foo(2147483647) is 2147483552
58PASS foo(2147483647) is 2147483552
59PASS foo(2147483647) is 2147483552
60PASS foo(2147483647) is 2147483552
61PASS foo(2147483647) is 2147483552
62PASS foo(2147483647) is 2147483552
63PASS foo(2147483647) is 2147483552
64PASS foo(2147483647) is 2147483552
65PASS foo(2147483647) is 2147483552
66PASS foo(2147483647) is 2147483552
67PASS foo(2147483647) is 2147483552
68PASS foo(2147483647) is 2147483552
69PASS foo(2147483647) is 2147483552
70PASS foo(2147483647) is 2147483552
71PASS foo(2147483647) is 2147483552
72PASS foo(2147483647) is 2147483552
73PASS foo(2147483647) is 2147483552
74PASS foo(2147483647) is 2147483552
75PASS foo(2147483647) is 2147483552
76PASS foo(2147483647) is 2147483552
77PASS foo(2147483647) is 2147483552
78PASS foo(2147483647) is 2147483552
79PASS foo(2147483647) is 2147483552
80PASS foo(2147483647) is 2147483552
81PASS foo(2147483647) is 2147483552
82PASS foo(2147483647) is 2147483552
83PASS foo(2147483647) is 2147483552
84PASS foo(2147483647) is 2147483552
85PASS foo(2147483647) is 2147483552
86PASS foo(2147483647) is 2147483552
87PASS foo(2147483647) is 2147483552
88PASS foo(2147483647) is 2147483552
89PASS foo(2147483647) is 2147483552
90PASS foo(2147483647) is 2147483552
91PASS foo(2147483647) is 2147483552
92PASS foo(2147483647) is 2147483552
93PASS foo(2147483647) is 2147483552
94PASS foo(2147483647) is 2147483552
95PASS foo(2147483647) is 2147483552
96PASS foo(2147483647) is 2147483552
97PASS foo(2147483647) is 2147483552
98PASS foo(2147483647) is 2147483552
99PASS foo(2147483647) is 2147483552
100PASS foo(2147483647) is 2147483552
101PASS foo(2147483647) is 2147483552
102PASS foo(2147483647) is 2147483552
103PASS foo(2147483647) is 2147483552
104PASS foo(2147483647) is 2147483552
105PASS foo(2147483647) is 2147483552
106PASS foo(2147483647) is 2147483552
107PASS foo(2147483647) is 2147483552
108PASS foo(2147483647) is 2147483552
109PASS foo(2147483647) is 2147483552
110PASS foo(2147483647) is 2147483552
111PASS foo(2147483647) is 2147483552
112PASS foo(2147483647) is 2147483552
113PASS foo(2147483647) is 2147483552
114PASS foo(2147483647) is 2147483552
115PASS foo(2147483647) is 2147483552
116PASS foo(2147483647) is 2147483552
117PASS foo(2147483647) is 2147483552
118PASS foo(2147483647) is 2147483552
119PASS foo(2147483647) is 2147483552
120PASS foo(2147483647) is 2147483552
121PASS foo(2147483647) is 2147483552
122PASS foo(2147483647) is 2147483552
123PASS foo(2147483647) is 2147483552
124PASS foo(2147483647) is 2147483552
125PASS foo(2147483647) is 2147483552
126PASS foo(2147483647) is 2147483552
127PASS foo(2147483647) is 2147483552
128PASS foo(2147483647) is 2147483552
129PASS foo(2147483647) is 2147483552
130PASS foo(2147483647) is 2147483552
131PASS foo(2147483647) is 2147483552
132PASS foo(2147483647) is 2147483552
133PASS foo(2147483647) is 2147483552
134PASS foo(2147483647) is 2147483552
135PASS foo(2147483647) is 2147483552
136PASS foo(2147483647) is 2147483552
137PASS foo(2147483647) is 2147483552
138PASS foo(2147483647) is 2147483552
139PASS foo(2147483647) is 2147483552
140PASS foo(2147483647) is 2147483552
141PASS foo(2147483647) is 2147483552
142PASS foo(2147483647) is 2147483552
143PASS foo(2147483647) is 2147483552
144PASS foo(2147483647) is 2147483552
145PASS foo(2147483647) is 2147483552
146PASS foo(2147483647) is 2147483552
147PASS foo(2147483647) is 2147483552
148PASS foo(2147483647) is 2147483552
149PASS foo(2147483647) is 2147483552
150PASS foo(2147483647) is 2147483552
151PASS foo(2147483647) is 2147483552
152PASS foo(2147483647) is 2147483552
153PASS foo(2147483647) is 2147483552
154PASS foo(2147483647) is 2147483552
155PASS foo(2147483647) is 2147483552
156PASS foo(2147483647) is 2147483552
157PASS foo(2147483647) is 2147483552
158PASS foo(2147483647) is 2147483552
159PASS foo(2147483647) is 2147483552
160PASS foo(2147483647) is 2147483552
161PASS foo(2147483647) is 2147483552
162PASS foo(2147483647) is 2147483552
163PASS foo(2147483647) is 2147483552
164PASS foo(2147483647) is 2147483552
165PASS foo(2147483647) is 2147483552
166PASS foo(2147483647) is 2147483552
167PASS foo(2147483647) is 2147483552
168PASS foo(2147483647) is 2147483552
169PASS foo(2147483647) is 2147483552
170PASS foo(2147483647) is 2147483552
171PASS foo(2147483647) is 2147483552
172PASS foo(2147483647) is 2147483552
173PASS foo(2147483647) is 2147483552
174PASS foo(2147483647) is 2147483552
175PASS foo(2147483647) is 2147483552
176PASS foo(2147483647) is 2147483552
177PASS foo(2147483647) is 2147483552
178PASS foo(2147483647) is 2147483552
179PASS foo(2147483647) is 2147483552
180PASS foo(2147483647) is 2147483552
181PASS foo(2147483647) is 2147483552
182PASS foo(2147483647) is 2147483552
183PASS foo(2147483647) is 2147483552
184PASS foo(2147483647) is 2147483552
185PASS foo(2147483647) is 2147483552
186PASS foo(2147483647) is 2147483552
187PASS foo(2147483647) is 2147483552
188PASS foo(2147483647) is 2147483552
189PASS foo(2147483647) is 2147483552
190PASS foo(2147483647) is 2147483552
191PASS foo(2147483647) is 2147483552
192PASS foo(2147483647) is 2147483552
193PASS foo(2147483647) is 2147483552
194PASS foo(2147483647) is 2147483552
195PASS foo(2147483647) is 2147483552
196PASS foo(2147483647) is 2147483552
197PASS foo(2147483647) is 2147483552
198PASS foo(2147483647) is 2147483552
199PASS foo(2147483647) is 2147483552
200PASS foo(2147483647) is 2147483552
201PASS foo(2147483647) is 2147483552
202PASS foo(2147483647) is 2147483552
203PASS foo(2147483647) is 2147483552
204PASS foo(2147483647) is 2147483552
205PASS foo(2147483647) is 2147483552
206PASS foo(2147483647) is 2147483552
207PASS foo(2147483647) is 2147483552
208PASS foo(2147483647) is 2147483552
209PASS foo(2147483647) is 2147483552
210PASS foo(2147483647) is 2147483552
211PASS foo(2147483647) is 2147483552
212PASS foo(2147483647) is 2147483552
213PASS foo(2147483647) is 2147483552
214PASS foo(2147483647) is 2147483552
215PASS foo(2147483647) is 2147483552
216PASS foo(2147483647) is 2147483552
217PASS foo(2147483647) is 2147483552
218PASS foo(2147483647) is 2147483552
219PASS foo(2147483647) is 2147483552
220PASS foo(2147483647) is 2147483552
221PASS foo(2147483647) is 2147483552
222PASS foo(2147483647) is 2147483552
223PASS foo(2147483647) is 2147483552
224PASS foo(2147483647) is 2147483552
225PASS foo(2147483647) is 2147483552
226PASS foo(2147483647) is 2147483552
227PASS foo(2147483647) is 2147483552
228PASS foo(2147483647) is 2147483552
229PASS successfullyParsed is true
230
231TEST COMPLETE
232
233