xref: /PHP-8.3/ext/opcache/tests/jit/mul_003.phpt (revision a1389a77)
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
7opcache.jit_buffer_size=32M
8;opcache.jit_debug=257
9--EXTENSIONS--
10opcache
11--SKIPIF--
12<?php
13if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
14?>
15--FILE--
16<?php
17
18function mul2_bound(int $a) {
19  $res = $a * -2147483648;
20  var_dump($res);
21}
22
23function mul1_bound(int $a) {
24  $res = -2147483648 * $a;
25  var_dump($res);
26}
27
28mul2_bound(3);
29mul1_bound(3);
30?>
31--EXPECT--
32int(-6442450944)
33int(-6442450944)