mul_003.phpt 559 B

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