bug77768.phpt 728 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. --TEST--
  2. Bug #77768 (Redeclaration of builtin types and repeated declarations)
  3. --EXTENSIONS--
  4. ffi
  5. --SKIPIF--
  6. <?php
  7. try {
  8. $libc = FFI::cdef("int printf(const char *format, ...);", "libc.so.6");
  9. } catch (Throwable $_) {
  10. die('skip libc.so.6 not available');
  11. }
  12. ?>
  13. --INI--
  14. ffi.enable=1
  15. --FILE--
  16. <?php
  17. $x = FFI::cdef("
  18. typedef __builtin_va_list __gnuc_va_list;
  19. typedef unsigned int uint8_t;
  20. typedef int64_t a;
  21. typedef int64_t b;
  22. typedef a c;
  23. typedef b c;
  24. struct point {int x,y;};
  25. typedef struct point d;
  26. typedef struct point d;
  27. int printf(const char *format, ...);
  28. int printf(const char *format, ...);
  29. ");
  30. var_dump(FFI::sizeof($x->new("uint8_t")));
  31. var_dump(FFI::sizeof(FFI::new("uint8_t")));
  32. ?>
  33. --EXPECT--
  34. int(4)
  35. int(1)