summaryrefslogtreecommitdiff
path: root/ext/opcache/tests/jit/reg_alloc_002.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/opcache/tests/jit/reg_alloc_002.phpt')
-rw-r--r--ext/opcache/tests/jit/reg_alloc_002.phpt28
1 files changed, 28 insertions, 0 deletions
diff --git a/ext/opcache/tests/jit/reg_alloc_002.phpt b/ext/opcache/tests/jit/reg_alloc_002.phpt
new file mode 100644
index 0000000000..e93c4f3d5b
--- /dev/null
+++ b/ext/opcache/tests/jit/reg_alloc_002.phpt
@@ -0,0 +1,28 @@
+--TEST--
+Register Alloction 002: SEND_VAL_EX uses %r0 as a temporay register
+--INI--
+opcache.enable=1
+opcache.enable_cli=1
+opcache.file_update_protection=0
+opcache.jit_buffer_size=1M
+opcache.protect_memory=1
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class A {
+ public function process($call) {
+ $i = 0;
+ foreach (array("a", "b", "c") as $attr) {
+ $call($i++, "xxx");
+ }
+ }
+}
+
+$a = new A();
+$a->process(function($i, $v) { var_dump($i); });
+?>
+--EXPECT--
+int(0)
+int(1)
+int(2)