xref: /php-src/ext/opcache/tests/jit/gh17190.phpt (revision f8d2e009)
1--TEST--
2GH-17190 (Assertion failure ext/opcache/jit/ir/ir_gcm.c)
3--EXTENSIONS--
4opcache
5--INI--
6opcache.enable=1
7opcache.enable_cli=1
8opcache.file_update_protection=0
9opcache.jit_buffer_size=32M
10opcache.jit=function
11--FILE--
12<?php
13$a = [2147483647,2147483647,2147483647,3,0,0,32,2147483584,127];
14echo @crc32(json_encode(bitwise_small_split($a))) . "\n";
15
16function bitwise_small_split($val) {
17    $split = 8;
18    $len = count($val);
19    while ($i != $len) {
20        if (!$overflow) {
21            $remaining -= $split;
22            $overflow = $split <= $remaining ? 0 : $split - $remaining;
23        } elseif (++$i != $len) {
24            $fusion[$i] >>= $overflow;
25            $remaining = 31 - $overflow;
26            $overflow = $split <= $remaining ? 0 : $split - $remaining;
27        }
28    }
29}
30?>
31--EXPECT--
32634125391
33