xref: /PHP-8.4/ext/opcache/tests/jit/mul_003.phpt (revision c16ad918)
1--TEST--
2JIT MUL: 003 boundary value for optmizing MUL to SHIFT
3--INI--
4opcache.enable=1
5opcache.enable_cli=1
6opcache.file_update_protection=0
7;opcache.jit_debug=257
8--EXTENSIONS--
9opcache
10--SKIPIF--
11<?php
12if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
13?>
14--FILE--
15<?php
16
17function mul2_bound(int $a) {
18  $res = $a * -2147483648;
19  var_dump($res);
20}
21
22function mul1_bound(int $a) {
23  $res = -2147483648 * $a;
24  var_dump($res);
25}
26
27mul2_bound(3);
28mul1_bound(3);
29?>
30--EXPECT--
31int(-6442450944)
32int(-6442450944)