summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/ffi/tests/100.phpt11
1 files changed, 9 insertions, 2 deletions
diff --git a/ext/ffi/tests/100.phpt b/ext/ffi/tests/100.phpt
index 7a3be47ec3..63fae8c215 100644
--- a/ext/ffi/tests/100.phpt
+++ b/ext/ffi/tests/100.phpt
@@ -13,14 +13,21 @@ try {
ffi.enable=1
--FILE--
<?php
+// Check if target supports "fastcall" calling convention
+try {
+ FFI::cdef("extern size_t __attribute__((fastcall)) (*zend_printf)(const char *format);");
+ $fastcall = "__attribute__((fastcall)) ";
+} catch (Throwable $e) {
+ $fastcall = "";
+}
$zend = FFI::cdef("
const char *get_zend_version(void);
//char *get_zend_version(void);
extern size_t (*zend_printf)(const char *format, ...);
- unsigned long __attribute__((fastcall)) zend_hash_func(const char *str, size_t len);
+ unsigned long $fastcall zend_hash_func(const char *str, size_t len);
- void __attribute__((fastcall)) zend_str_tolower(char *str, size_t length);
+ void $fastcall zend_str_tolower(char *str, size_t length);
");
var_dump(trim(explode("\n",$zend->get_zend_version())[0]));