xref: /PHP-8.1/ext/opcache/tests/jit/add_011.phpt (revision cfde86a0)
1--TEST--
2JIT ADD: 011 overflow handling
3--INI--
4opcache.enable=1
5opcache.enable_cli=1
6opcache.file_update_protection=0
7opcache.jit_buffer_size=1M
8--SKIPIF--
9<?php if (PHP_INT_SIZE != 8) die("skip: 64-bit only"); ?>
10--FILE--
11<?php
12function test() {
13    $n = $a = 0;
14    while ($a <= 0) {
15        $a &= $a-- + $a + $u;
16        var_dump($a);
17        if (++$n > 59) die("bug\n");
18    }
19}
20test();
21?>
22--EXPECTF--
23Warning: Undefined variable $u in %sadd_011.php on line 5
24int(-1)
25
26Warning: Undefined variable $u in %sadd_011.php on line 5
27int(-4)
28
29Warning: Undefined variable $u in %sadd_011.php on line 5
30int(-13)
31
32Warning: Undefined variable $u in %sadd_011.php on line 5
33int(-32)
34
35Warning: Undefined variable $u in %sadd_011.php on line 5
36int(-97)
37
38Warning: Undefined variable $u in %sadd_011.php on line 5
39int(-228)
40
41Warning: Undefined variable $u in %sadd_011.php on line 5
42int(-493)
43
44Warning: Undefined variable $u in %sadd_011.php on line 5
45int(-1024)
46
47Warning: Undefined variable $u in %sadd_011.php on line 5
48int(-3073)
49
50Warning: Undefined variable $u in %sadd_011.php on line 5
51int(-7172)
52
53Warning: Undefined variable $u in %sadd_011.php on line 5
54int(-15373)
55
56Warning: Undefined variable $u in %sadd_011.php on line 5
57int(-31776)
58
59Warning: Undefined variable $u in %sadd_011.php on line 5
60int(-64609)
61
62Warning: Undefined variable $u in %sadd_011.php on line 5
63int(-130276)
64
65Warning: Undefined variable $u in %sadd_011.php on line 5
66int(-261613)
67
68Warning: Undefined variable $u in %sadd_011.php on line 5
69int(-524288)
70
71Warning: Undefined variable $u in %sadd_011.php on line 5
72int(-1572865)
73
74Warning: Undefined variable $u in %sadd_011.php on line 5
75int(-3670020)
76
77Warning: Undefined variable $u in %sadd_011.php on line 5
78int(-7864333)
79
80Warning: Undefined variable $u in %sadd_011.php on line 5
81int(-16252960)
82
83Warning: Undefined variable $u in %sadd_011.php on line 5
84int(-33030241)
85
86Warning: Undefined variable $u in %sadd_011.php on line 5
87int(-66584804)
88
89Warning: Undefined variable $u in %sadd_011.php on line 5
90int(-133693933)
91
92Warning: Undefined variable $u in %sadd_011.php on line 5
93int(-267912192)
94
95Warning: Undefined variable $u in %sadd_011.php on line 5
96int(-536349697)
97
98Warning: Undefined variable $u in %sadd_011.php on line 5
99int(-1073224708)
100
101Warning: Undefined variable $u in %sadd_011.php on line 5
102int(-2146974733)
103
104Warning: Undefined variable $u in %sadd_011.php on line 5
105int(-4294474784)
106
107Warning: Undefined variable $u in %sadd_011.php on line 5
108int(-8589474913)
109
110Warning: Undefined variable $u in %sadd_011.php on line 5
111int(-17179475172)
112
113Warning: Undefined variable $u in %sadd_011.php on line 5
114int(-34359475693)
115
116Warning: Undefined variable $u in %sadd_011.php on line 5
117int(-68719476736)
118
119Warning: Undefined variable $u in %sadd_011.php on line 5
120int(-206158430209)
121
122Warning: Undefined variable $u in %sadd_011.php on line 5
123int(-481036337156)
124
125Warning: Undefined variable $u in %sadd_011.php on line 5
126int(-1030792151053)
127
128Warning: Undefined variable $u in %sadd_011.php on line 5
129int(-2130303778848)
130
131Warning: Undefined variable $u in %sadd_011.php on line 5
132int(-4329327034465)
133
134Warning: Undefined variable $u in %sadd_011.php on line 5
135int(-8727373545700)
136
137Warning: Undefined variable $u in %sadd_011.php on line 5
138int(-17523466568173)
139
140Warning: Undefined variable $u in %sadd_011.php on line 5
141int(-35115652613120)
142
143Warning: Undefined variable $u in %sadd_011.php on line 5
144int(-70300024704001)
145
146Warning: Undefined variable $u in %sadd_011.php on line 5
147int(-140668768885764)
148
149Warning: Undefined variable $u in %sadd_011.php on line 5
150int(-281406257249293)
151
152Warning: Undefined variable $u in %sadd_011.php on line 5
153int(-562881233976352)
154
155Warning: Undefined variable $u in %sadd_011.php on line 5
156int(-1125831187430497)
157
158Warning: Undefined variable $u in %sadd_011.php on line 5
159int(-2251731094338788)
160
161Warning: Undefined variable $u in %sadd_011.php on line 5
162int(-4503530908155373)
163
164Warning: Undefined variable $u in %sadd_011.php on line 5
165int(-9007130535788544)
166
167Warning: Undefined variable $u in %sadd_011.php on line 5
168int(-18014329791578113)
169
170Warning: Undefined variable $u in %sadd_011.php on line 5
171int(-36028728303157252)
172
173Warning: Undefined variable $u in %sadd_011.php on line 5
174int(-72057525326315533)
175
176Warning: Undefined variable $u in %sadd_011.php on line 5
177int(-144115119372632096)
178
179Warning: Undefined variable $u in %sadd_011.php on line 5
180int(-288230307465265249)
181
182Warning: Undefined variable $u in %sadd_011.php on line 5
183int(-576460683650531556)
184
185Warning: Undefined variable $u in %sadd_011.php on line 5
186int(-1152921436021064173)
187
188Warning: Undefined variable $u in %sadd_011.php on line 5
189int(-2305842940762129408)
190
191Warning: Undefined variable $u in %sadd_011.php on line 5
192int(-4611685950244260865)
193
194Warning: Undefined variable $u in %sadd_011.php on line 5
195int(-9223371969208523780)
196
197Warning: Undefined variable $u in %sadd_011.php on line 5
198
199Deprecated: Implicit conversion from float %f to int loses precision in %sadd_011.php on line 5
200int(66572500992)