ffi 1.0.11 → 1.0.12.pre

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of ffi might be problematic. Click here for more details.

Files changed (159) hide show
  1. data/Rakefile +1 -1
  2. data/ext/ffi_c/AbstractMemory.c +9 -0
  3. data/ext/ffi_c/AbstractMemory.h +4 -0
  4. data/ext/ffi_c/Buffer.c +8 -0
  5. data/ext/ffi_c/Call.c +8 -0
  6. data/ext/ffi_c/ClosurePool.c +12 -0
  7. data/ext/ffi_c/DynamicLibrary.c +7 -1
  8. data/ext/ffi_c/Function.c +11 -1
  9. data/ext/ffi_c/Function.h +6 -0
  10. data/ext/ffi_c/FunctionInfo.c +8 -0
  11. data/ext/ffi_c/LastError.c +8 -0
  12. data/ext/ffi_c/MemoryPointer.c +8 -0
  13. data/ext/ffi_c/MemoryPointer.h +6 -0
  14. data/ext/ffi_c/MethodHandle.c +8 -0
  15. data/ext/ffi_c/Platform.c +8 -0
  16. data/ext/ffi_c/Pointer.c +8 -0
  17. data/ext/ffi_c/Pointer.h +6 -0
  18. data/ext/ffi_c/Struct.c +6 -0
  19. data/ext/ffi_c/StructByReference.c +8 -0
  20. data/ext/ffi_c/StructByValue.c +8 -0
  21. data/ext/ffi_c/StructLayout.c +6 -0
  22. data/ext/ffi_c/Thread.c +7 -0
  23. data/ext/ffi_c/Thread.h +6 -0
  24. data/ext/ffi_c/Type.c +3 -0
  25. data/ext/ffi_c/Types.h +4 -0
  26. data/ext/ffi_c/Variadic.c +8 -0
  27. data/ext/ffi_c/endian.h +3 -0
  28. data/ext/ffi_c/extconf.rb +6 -1
  29. data/ext/ffi_c/libffi.vc.mk +26 -0
  30. data/ext/ffi_c/libffi.vc64.mk +26 -0
  31. data/ext/ffi_c/libffi/ChangeLog +541 -0
  32. data/ext/ffi_c/libffi/ChangeLog.libffi +13 -87
  33. data/ext/ffi_c/libffi/LICENSE +3 -3
  34. data/ext/ffi_c/libffi/Makefile.am +41 -32
  35. data/ext/ffi_c/libffi/Makefile.in +95 -66
  36. data/ext/ffi_c/libffi/Makefile.vc +141 -0
  37. data/ext/ffi_c/libffi/Makefile.vc64 +141 -0
  38. data/ext/ffi_c/libffi/README +40 -4
  39. data/ext/ffi_c/libffi/aclocal.m4 +729 -7854
  40. data/ext/ffi_c/libffi/build-ios.sh +67 -0
  41. data/ext/ffi_c/libffi/compile +11 -10
  42. data/ext/ffi_c/libffi/config.guess +4 -1
  43. data/ext/ffi_c/libffi/config.sub +6 -3
  44. data/ext/ffi_c/libffi/configure +6264 -6354
  45. data/ext/ffi_c/libffi/configure.ac +155 -63
  46. data/ext/ffi_c/libffi/depcomp +81 -35
  47. data/ext/ffi_c/libffi/doc/libffi.info +78 -18
  48. data/ext/ffi_c/libffi/doc/libffi.texi +64 -5
  49. data/ext/ffi_c/libffi/doc/stamp-vti +4 -4
  50. data/ext/ffi_c/libffi/doc/version.texi +4 -4
  51. data/ext/ffi_c/libffi/fficonfig.h.in +18 -0
  52. data/ext/ffi_c/libffi/fficonfig.hw +57 -0
  53. data/ext/ffi_c/libffi/include/Makefile.in +21 -3
  54. data/ext/ffi_c/libffi/include/ffi.h.in +42 -14
  55. data/ext/ffi_c/libffi/include/ffi.h.vc +427 -0
  56. data/ext/ffi_c/libffi/include/ffi.h.vc64 +427 -0
  57. data/ext/ffi_c/libffi/include/ffi_common.h +9 -5
  58. data/ext/ffi_c/libffi/install-sh +364 -167
  59. data/ext/ffi_c/libffi/ltmain.sh +2599 -1369
  60. data/ext/ffi_c/libffi/m4/ax_cc_maxopt.m4 +176 -0
  61. data/ext/ffi_c/libffi/m4/ax_cflags_warn_all.m4 +195 -0
  62. data/ext/ffi_c/libffi/m4/ax_check_compiler_flags.m4 +76 -0
  63. data/ext/ffi_c/libffi/m4/ax_compiler_vendor.m4 +63 -0
  64. data/ext/ffi_c/libffi/m4/ax_configure_args.m4 +70 -0
  65. data/ext/ffi_c/libffi/m4/ax_enable_builddir.m4 +300 -0
  66. data/ext/ffi_c/libffi/m4/ax_gcc_archflag.m4 +215 -0
  67. data/ext/ffi_c/libffi/m4/ax_gcc_x86_cpuid.m4 +79 -0
  68. data/ext/ffi_c/libffi/m4/libtool.m4 +1239 -768
  69. data/ext/ffi_c/libffi/m4/ltoptions.m4 +7 -6
  70. data/ext/ffi_c/libffi/m4/ltversion.m4 +6 -6
  71. data/ext/ffi_c/libffi/m4/lt~obsolete.m4 +9 -3
  72. data/ext/ffi_c/libffi/man/Makefile.in +21 -3
  73. data/ext/ffi_c/libffi/mdate-sh +0 -0
  74. data/ext/ffi_c/libffi/missing +60 -44
  75. data/ext/ffi_c/libffi/msvcc.sh +197 -0
  76. data/ext/ffi_c/libffi/src/alpha/osf.S +39 -18
  77. data/ext/ffi_c/libffi/src/arm/ffi.c +443 -24
  78. data/ext/ffi_c/libffi/src/arm/ffitarget.h +17 -1
  79. data/ext/ffi_c/libffi/src/arm/gentramp.sh +118 -0
  80. data/ext/ffi_c/libffi/src/arm/sysv.S +206 -15
  81. data/ext/ffi_c/libffi/src/arm/trampoline.S +4450 -0
  82. data/ext/ffi_c/libffi/src/avr32/ffi.c +4 -2
  83. data/ext/ffi_c/libffi/src/avr32/ffitarget.h +2 -2
  84. data/ext/ffi_c/libffi/src/closures.c +17 -35
  85. data/ext/ffi_c/libffi/src/cris/ffi.c +1 -1
  86. data/ext/ffi_c/libffi/src/cris/ffitarget.h +2 -2
  87. data/ext/ffi_c/libffi/src/dlmalloc.c +66 -4
  88. data/ext/ffi_c/libffi/src/frv/ffitarget.h +2 -6
  89. data/ext/ffi_c/libffi/src/ia64/ffi.c +7 -5
  90. data/ext/ffi_c/libffi/src/ia64/ffitarget.h +2 -2
  91. data/ext/ffi_c/libffi/src/java_raw_api.c +1 -1
  92. data/ext/ffi_c/libffi/src/m32r/ffitarget.h +2 -2
  93. data/ext/ffi_c/libffi/src/m68k/ffi.c +10 -0
  94. data/ext/ffi_c/libffi/src/m68k/ffitarget.h +2 -2
  95. data/ext/ffi_c/libffi/src/m68k/sysv.S +36 -0
  96. data/ext/ffi_c/libffi/src/mips/ffi.c +12 -5
  97. data/ext/ffi_c/libffi/src/mips/ffitarget.h +18 -11
  98. data/ext/ffi_c/libffi/src/mips/n32.S +4 -4
  99. data/ext/ffi_c/libffi/src/moxie/eabi.S +128 -0
  100. data/ext/ffi_c/libffi/src/moxie/ffi.c +276 -0
  101. data/ext/ffi_c/libffi/src/pa/ffi.c +7 -4
  102. data/ext/ffi_c/libffi/src/pa/ffitarget.h +6 -5
  103. data/ext/ffi_c/libffi/src/powerpc/aix.S +5 -1
  104. data/ext/ffi_c/libffi/src/powerpc/aix_closure.S +2 -0
  105. data/ext/ffi_c/libffi/src/powerpc/asm.h +1 -1
  106. data/ext/ffi_c/libffi/src/powerpc/darwin.S +215 -77
  107. data/ext/ffi_c/libffi/src/powerpc/darwin_closure.S +358 -100
  108. data/ext/ffi_c/libffi/src/powerpc/ffi.c +11 -5
  109. data/ext/ffi_c/libffi/src/powerpc/ffi_darwin.c +603 -172
  110. data/ext/ffi_c/libffi/src/powerpc/ffitarget.h +17 -4
  111. data/ext/ffi_c/libffi/src/prep_cif.c +16 -13
  112. data/ext/ffi_c/libffi/src/s390/ffitarget.h +4 -2
  113. data/ext/ffi_c/libffi/src/sh/ffitarget.h +2 -2
  114. data/ext/ffi_c/libffi/src/sh64/ffitarget.h +2 -2
  115. data/ext/ffi_c/libffi/src/sparc/ffi.c +55 -11
  116. data/ext/ffi_c/libffi/src/sparc/ffitarget.h +5 -3
  117. data/ext/ffi_c/libffi/src/x86/ffi.c +54 -92
  118. data/ext/ffi_c/libffi/src/x86/ffi64.c +17 -8
  119. data/ext/ffi_c/libffi/src/x86/ffitarget.h +15 -14
  120. data/ext/ffi_c/libffi/src/x86/sysv.S +40 -26
  121. data/ext/ffi_c/libffi/src/x86/unix64.S +4 -0
  122. data/ext/ffi_c/libffi/src/x86/win32.S +379 -191
  123. data/ext/ffi_c/libffi/src/x86/win64.S +15 -7
  124. data/ext/ffi_c/libffi/testsuite/Makefile.am +1 -1
  125. data/ext/ffi_c/libffi/testsuite/Makefile.in +22 -4
  126. data/ext/ffi_c/libffi/testsuite/lib/libffi.exp +350 -0
  127. data/ext/ffi_c/libffi/testsuite/libffi.call/call.exp +1 -5
  128. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_longdouble_split.c +1 -1
  129. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_longdouble_split2.c +1 -1
  130. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_sint64.c +1 -0
  131. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_uint64.c +1 -0
  132. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_double_va.c +3 -0
  133. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_longdouble.c +2 -2
  134. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_longdouble_va.c +3 -0
  135. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_pointer.c +1 -1
  136. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_pointer_stack.c +1 -1
  137. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_ulonglong.c +1 -0
  138. data/ext/ffi_c/libffi/testsuite/libffi.call/err_bad_abi.c +2 -3
  139. data/ext/ffi_c/libffi/testsuite/libffi.call/err_bad_typedef.c +2 -1
  140. data/ext/ffi_c/libffi/testsuite/libffi.call/ffitest.h +36 -0
  141. data/ext/ffi_c/libffi/testsuite/libffi.call/huge_struct.c +17 -17
  142. data/ext/ffi_c/libffi/testsuite/libffi.call/return_ll1.c +1 -0
  143. data/ext/ffi_c/libffi/testsuite/libffi.call/stret_medium2.c +1 -0
  144. data/ext/ffi_c/libffi/testsuite/libffi.special/ffitestcxx.h +1 -1
  145. data/ext/ffi_c/libffi/testsuite/libffi.special/special.exp +1 -3
  146. data/ext/ffi_c/win32/stdint.h +199 -0
  147. data/gen/Rakefile +18 -2
  148. data/lib/ffi/platform/arm-linux/types.conf +102 -0
  149. data/lib/ffi/platform/i486-gnu/types.conf +107 -0
  150. data/lib/ffi/platform/ia64-linux/types.conf +102 -0
  151. data/lib/ffi/platform/mips-linux/types.conf +102 -0
  152. data/lib/ffi/platform/mipsel-linux/types.conf +102 -0
  153. data/lib/ffi/platform/powerpc-linux/types.conf +100 -0
  154. data/lib/ffi/platform/s390-linux/types.conf +102 -0
  155. data/lib/ffi/platform/s390x-linux/types.conf +102 -0
  156. data/lib/ffi/platform/sparc-linux/types.conf +102 -0
  157. data/lib/ffi/tools/types_generator.rb +8 -1
  158. data/lib/ffi_c.bundle +0 -0
  159. metadata +72 -42
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2003, 2006, 2009 Free Software Foundation, Inc.
1
+ # Copyright (C) 2003, 2006, 2009, 2010 Free Software Foundation, Inc.
2
2
 
3
3
  # This program is free software; you can redistribute it and/or modify
4
4
  # it under the terms of the GNU General Public License as published by
@@ -14,10 +14,6 @@
14
14
  # along with this program; see the file COPYING3. If not see
15
15
  # <http://www.gnu.org/licenses/>.
16
16
 
17
- # libffi testsuite that uses the 'dg.exp' driver.
18
-
19
- load_lib libffi-dg.exp
20
-
21
17
  dg-init
22
18
  libffi-init
23
19
 
@@ -6,7 +6,7 @@
6
6
 
7
7
  /* { dg-excess-errors "no long double format" { xfail x86_64-*-mingw* x86_64-*-cygwin* } } */
8
8
  /* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */
9
- /* { dg-options -mlong-double-128 { target powerpc64*-*-* } } */
9
+ /* { dg-options -mlong-double-128 { target powerpc64*-*-linux* } } */
10
10
  /* { dg-output "" { xfail x86_64-*-mingw* x86_64-*-cygwin* } } */
11
11
 
12
12
  #include "ffitest.h"
@@ -7,7 +7,7 @@
7
7
 
8
8
  /* { dg-excess-errors "no long double format" { xfail x86_64-*-mingw* x86_64-*-cygwin* } } */
9
9
  /* { dg-do run { xfail strongarm*-*-* } } */
10
- /* { dg-options -mlong-double-128 { target powerpc64*-*-* } } */
10
+ /* { dg-options -mlong-double-128 { target powerpc64*-*-linux* } } */
11
11
  /* { dg-output "" { xfail x86_64-*-mingw* x86_64-*-cygwin* } } */
12
12
 
13
13
  #include "ffitest.h"
@@ -5,6 +5,7 @@
5
5
  Originator: <hos@tamanegi.org> 20031203 */
6
6
 
7
7
  /* { dg-do run } */
8
+ /* { dg-options "-Wno-format" { target alpha*-dec-osf* } } */
8
9
  #include "ffitest.h"
9
10
 
10
11
  typedef struct cls_struct_align {
@@ -6,6 +6,7 @@
6
6
 
7
7
 
8
8
  /* { dg-do run } */
9
+ /* { dg-options "-Wno-format" { target alpha*-dec-osf* } } */
9
10
  #include "ffitest.h"
10
11
 
11
12
  typedef struct cls_struct_align {
@@ -6,6 +6,9 @@
6
6
 
7
7
  /* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */
8
8
  /* { dg-output "" { xfail avr32*-*-* } } */
9
+ /* { dg-output "" { xfail mips-sgi-irix6* } } PR libffi/46660 */
10
+ /* { dg-skip-if "" arm*-*-* { "-mfloat-abi=hard" } { "" } } */
11
+
9
12
  #include "ffitest.h"
10
13
 
11
14
  static void
@@ -5,8 +5,8 @@
5
5
  Originator: Blake Chaffin */
6
6
 
7
7
  /* { dg-excess-errors "no long double format" { xfail x86_64-*-mingw* x86_64-*-cygwin* } } */
8
- /* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */
9
- /* { dg-options -mlong-double-128 { target powerpc64*-*-* } } */
8
+ /* { dg-do run { xfail arm*-*-* strongarm*-*-* xscale*-*-* } } */
9
+ /* { dg-options -mlong-double-128 { target powerpc64*-*-linux* } } */
10
10
  /* { dg-output "" { xfail x86_64-*-mingw* x86_64-*-cygwin* } } */
11
11
 
12
12
  #include "ffitest.h"
@@ -6,6 +6,9 @@
6
6
 
7
7
  /* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */
8
8
  /* { dg-output "" { xfail avr32*-*-* x86_64-*-mingw* } } */
9
+ /* { dg-output "" { xfail mips-sgi-irix6* } } PR libffi/46660 */
10
+ /* { dg-skip-if "" arm*-*-* { "-mfloat-abi=hard" } { "" } } */
11
+
9
12
  #include "ffitest.h"
10
13
 
11
14
  static void
@@ -65,7 +65,7 @@ int main (void)
65
65
 
66
66
  CHECK(ffi_prep_closure_loc(pcl, &cif, cls_pointer_gn, NULL, code) == FFI_OK);
67
67
 
68
- res = (ffi_arg)((void*(*)(void*, void*))(code))(arg1, arg2);
68
+ res = (ffi_arg)(uintptr_t)((void*(*)(void*, void*))(code))(arg1, arg2);
69
69
  /* { dg-output "\n0x12345678 0x89abcdef: 0x9be02467" } */
70
70
  printf("res: 0x%08x\n", (unsigned int) res);
71
71
  /* { dg-output "\nres: 0x9be02467" } */
@@ -129,7 +129,7 @@ int main (void)
129
129
 
130
130
  CHECK(ffi_prep_closure_loc(pcl, &cif, cls_pointer_gn, NULL, code) == FFI_OK);
131
131
 
132
- res = (ffi_arg)((void*(*)(void*, void*))(code))(arg1, arg2);
132
+ res = (ffi_arg)(uintptr_t)((void*(*)(void*, void*))(code))(arg1, arg2);
133
133
 
134
134
  printf("res: 0x%08x\n", (unsigned int) res);
135
135
  // { dg-output "\n0x01234567 0x89abcdef: 0x8acf1356" }
@@ -5,6 +5,7 @@
5
5
  Originator: <andreast@gcc.gnu.org> 20030828 */
6
6
 
7
7
  /* { dg-do run } */
8
+ /* { dg-options "-Wno-format" { target alpha*-dec-osf* } } */
8
9
  #include "ffitest.h"
9
10
 
10
11
  static void cls_ret_ulonglong_fn(ffi_cif* cif __UNUSED__, void* resp,
@@ -4,7 +4,8 @@
4
4
  PR: none.
5
5
  Originator: Blake Chaffin 6/6/2007 */
6
6
 
7
- /* { dg-do run { xfail *-*-* } } */
7
+ /* { dg-do run } */
8
+
8
9
  #include "ffitest.h"
9
10
 
10
11
  static void
@@ -17,11 +18,9 @@ int main (void)
17
18
  ffi_cif cif;
18
19
  void *code;
19
20
  ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
20
- void* args[1];
21
21
  ffi_type* arg_types[1];
22
22
 
23
23
  arg_types[0] = NULL;
24
- args[0] = NULL;
25
24
 
26
25
  CHECK(ffi_prep_cif(&cif, 255, 0, &ffi_type_void,
27
26
  arg_types) == FFI_BAD_ABI);
@@ -4,7 +4,8 @@
4
4
  PR: none.
5
5
  Originator: Blake Chaffin 6/6/2007 */
6
6
 
7
- /* { dg-do run { xfail *-*-* } } */
7
+ /* { dg-do run } */
8
+
8
9
  #include "ffitest.h"
9
10
 
10
11
  int main (void)
@@ -60,11 +60,47 @@
60
60
  #define PRIuLL "llu"
61
61
  #endif
62
62
 
63
+ /* Tru64 UNIX kludge. */
64
+ #if defined(__alpha__) && defined(__osf__)
65
+ /* Tru64 UNIX V4.0 doesn't support %lld/%lld, but long is 64-bit. */
66
+ #undef PRIdLL
67
+ #define PRIdLL "ld"
68
+ #undef PRIuLL
69
+ #define PRIuLL "lu"
70
+ #define PRId8 "hd"
71
+ #define PRIu8 "hu"
72
+ #define PRId64 "ld"
73
+ #define PRIu64 "lu"
74
+ #define PRIuPTR "lu"
75
+ #endif
76
+
63
77
  /* PA HP-UX kludge. */
64
78
  #if defined(__hppa__) && defined(__hpux__) && !defined(PRIuPTR)
65
79
  #define PRIuPTR "lu"
66
80
  #endif
67
81
 
82
+ /* IRIX kludge. */
83
+ #if defined(__sgi)
84
+ /* IRIX 6.5 <inttypes.h> provides all definitions, but only for C99
85
+ compilations. */
86
+ #define PRId8 "hhd"
87
+ #define PRIu8 "hhu"
88
+ #if (_MIPS_SZLONG == 32)
89
+ #define PRId64 "lld"
90
+ #define PRIu64 "llu"
91
+ #endif
92
+ /* This doesn't match <inttypes.h>, which always has "lld" here, but the
93
+ arguments are uint64_t, int64_t, which are unsigned long, long for
94
+ 64-bit in <sgidefs.h>. */
95
+ #if (_MIPS_SZLONG == 64)
96
+ #define PRId64 "ld"
97
+ #define PRIu64 "lu"
98
+ #endif
99
+ /* This doesn't match <inttypes.h>, which has "u" here, but the arguments
100
+ are uintptr_t, which is always unsigned long. */
101
+ #define PRIuPTR "lu"
102
+ #endif
103
+
68
104
  /* Solaris < 10 kludge. */
69
105
  #if defined(__sun__) && defined(__svr4__) && !defined(PRIuPTR)
70
106
  #if defined(__arch64__) || defined (__x86_64__)
@@ -7,7 +7,7 @@
7
7
 
8
8
  /* { dg-excess-errors "" { target x86_64-*-mingw* x86_64-*-cygwin* } } */
9
9
  /* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */
10
- /* { dg-options -mlong-double-128 { target powerpc64*-*-* } } */
10
+ /* { dg-options -mlong-double-128 { target powerpc64*-*-linux* } } */
11
11
  /* { dg-output "" { xfail x86_64-*-mingw* x86_64-*-cygwin* } } */
12
12
 
13
13
  #include "ffitest.h"
@@ -129,14 +129,14 @@ test_large_fn(
129
129
  ui64_4 + 4, si64_4 + 4, f_4 + 4, d_4 + 4, ld_4 + 4, (char*)((intptr_t)p_4 + 4),
130
130
  ui8_5 + 5, si8_5 + 5};
131
131
 
132
- printf("%hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
133
- "%hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
134
- "%hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
135
- "%hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx %hhu %hhd: "
136
- "%hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
137
- "%hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
138
- "%hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
139
- "%hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx %hhu %hhd\n",
132
+ printf("%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
133
+ "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
134
+ "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
135
+ "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx %" PRIu8 " %" PRId8 ": "
136
+ "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
137
+ "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
138
+ "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
139
+ "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx %" PRIu8 " %" PRId8 "\n",
140
140
  ui8_1, si8_1, ui16_1, si16_1, ui32_1, si32_1, ui64_1, si64_1, f_1, d_1, ld_1, (unsigned long)p_1,
141
141
  ui8_2, si8_2, ui16_2, si16_2, ui32_2, si32_2, ui64_2, si64_2, f_2, d_2, ld_2, (unsigned long)p_2,
142
142
  ui8_3, si8_3, ui16_3, si16_3, ui32_3, si32_3, ui64_3, si64_3, f_3, d_3, ld_3, (unsigned long)p_3,
@@ -296,10 +296,10 @@ main(int argc __UNUSED__, const char** argv __UNUSED__)
296
296
 
297
297
  ffi_call(&cif, FFI_FN(test_large_fn), &retVal, argValues);
298
298
  // { dg-output "1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2: 2 3 4 5 6 7 8 9 10 11 12 0x12345679 3 4 5 6 7 8 9 10 11 12 13 0x1234567a 4 5 6 7 8 9 10 11 12 13 14 0x1234567b 5 6 7 8 9 10 11 12 13 14 15 0x1234567c 6 7" }
299
- printf("res: %hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
300
- "%hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
301
- "%hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
302
- "%hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx %hhu %hhd\n",
299
+ printf("res: %" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
300
+ "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
301
+ "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
302
+ "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx %" PRIu8 " %" PRId8 "\n",
303
303
  retVal.a, retVal.b, retVal.c, retVal.d, retVal.e, retVal.f,
304
304
  retVal.g, retVal.h, retVal.i, retVal.j, retVal.k, (unsigned long)retVal.l,
305
305
  retVal.m, retVal.n, retVal.o, retVal.p, retVal.q, retVal.r,
@@ -324,10 +324,10 @@ main(int argc __UNUSED__, const char** argv __UNUSED__)
324
324
  ui8, si8, ui16, si16, ui32, si32, ui64, si64, f, d, ld, p,
325
325
  ui8, si8);
326
326
  // { dg-output "\n1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2: 2 3 4 5 6 7 8 9 10 11 12 0x12345679 3 4 5 6 7 8 9 10 11 12 13 0x1234567a 4 5 6 7 8 9 10 11 12 13 14 0x1234567b 5 6 7 8 9 10 11 12 13 14 15 0x1234567c 6 7" }
327
- printf("res: %hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
328
- "%hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
329
- "%hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
330
- "%hhu %hhd %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx %hhu %hhd\n",
327
+ printf("res: %" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
328
+ "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
329
+ "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
330
+ "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx %" PRIu8 " %" PRId8 "\n",
331
331
  retVal.a, retVal.b, retVal.c, retVal.d, retVal.e, retVal.f,
332
332
  retVal.g, retVal.h, retVal.i, retVal.j, retVal.k, (unsigned long)retVal.l,
333
333
  retVal.m, retVal.n, retVal.o, retVal.p, retVal.q, retVal.r,
@@ -5,6 +5,7 @@
5
5
  Originator: <andreast@gcc.gnu.org> 20050222 */
6
6
 
7
7
  /* { dg-do run } */
8
+ /* { dg-options "-Wno-format" { target alpha*-dec-osf* } } */
8
9
  #include "ffitest.h"
9
10
  static long long return_ll(int ll0, long long ll1, int ll2)
10
11
  {
@@ -7,6 +7,7 @@
7
7
  Originator: Blake Chaffin 6/21/2007 */
8
8
 
9
9
  /* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */
10
+ /* { dg-options "-Wno-format" { target alpha*-dec-osf* } } */
10
11
  #include "ffitest.h"
11
12
 
12
13
  typedef struct struct_72byte {
@@ -84,7 +84,7 @@ allocate_mmap (size_t size)
84
84
  MAP_PRIVATE, dev_zero_fd, 0);
85
85
  #endif
86
86
 
87
- if (page == MAP_FAILED)
87
+ if (page == (char *) MAP_FAILED)
88
88
  {
89
89
  perror ("virtual memory exhausted");
90
90
  exit (1);
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2003, 2006, 2009 Free Software Foundation, Inc.
1
+ # Copyright (C) 2003, 2006, 2009, 2010 Free Software Foundation, Inc.
2
2
 
3
3
  # This program is free software; you can redistribute it and/or modify
4
4
  # it under the terms of the GNU General Public License as published by
@@ -14,8 +14,6 @@
14
14
  # along with this program; see the file COPYING3. If not see
15
15
  # <http://www.gnu.org/licenses/>.
16
16
 
17
- load_lib libffi-dg.exp
18
-
19
17
  dg-init
20
18
  libffi-init
21
19
 
@@ -0,0 +1,199 @@
1
+ /* stdint.h standard header */
2
+ #pragma once
3
+ #ifndef _STDINT
4
+ #define _STDINT
5
+ #ifndef RC_INVOKED
6
+ #include <yvals.h>
7
+
8
+ /* NB: assumes
9
+ byte has 8 bits
10
+ long is 32 bits
11
+ pointer can convert to and from long long
12
+ long long is longest type
13
+ */
14
+
15
+ _C_STD_BEGIN
16
+ /* TYPE DEFINITIONS */
17
+ typedef signed char int8_t;
18
+ typedef short int16_t;
19
+ typedef int int32_t;
20
+
21
+ typedef unsigned char uint8_t;
22
+ typedef unsigned short uint16_t;
23
+ typedef unsigned int uint32_t;
24
+
25
+ typedef signed char int_least8_t;
26
+ typedef short int_least16_t;
27
+ typedef int int_least32_t;
28
+
29
+ typedef unsigned char uint_least8_t;
30
+ typedef unsigned short uint_least16_t;
31
+ typedef unsigned int uint_least32_t;
32
+
33
+ typedef char int_fast8_t;
34
+ typedef int int_fast16_t;
35
+ typedef int int_fast32_t;
36
+
37
+ typedef unsigned char uint_fast8_t;
38
+ typedef unsigned int uint_fast16_t;
39
+ typedef unsigned int uint_fast32_t;
40
+
41
+ #ifndef _INTPTR_T_DEFINED
42
+ #define _INTPTR_T_DEFINED
43
+ #ifdef _WIN64
44
+ typedef __int64 intptr_t;
45
+ #else /* _WIN64 */
46
+ typedef _W64 int intptr_t;
47
+ #endif /* _WIN64 */
48
+ #endif /* _INTPTR_T_DEFINED */
49
+
50
+ #ifndef _UINTPTR_T_DEFINED
51
+ #define _UINTPTR_T_DEFINED
52
+ #ifdef _WIN64
53
+ typedef unsigned __int64 uintptr_t;
54
+ #else /* _WIN64 */
55
+ typedef _W64 unsigned int uintptr_t;
56
+ #endif /* _WIN64 */
57
+ #endif /* _UINTPTR_T_DEFINED */
58
+
59
+ typedef _Longlong int64_t;
60
+ typedef _ULonglong uint64_t;
61
+
62
+ typedef _Longlong int_least64_t;
63
+ typedef _ULonglong uint_least64_t;
64
+
65
+ typedef _Longlong int_fast64_t;
66
+ typedef _ULonglong uint_fast64_t;
67
+
68
+ typedef _Longlong intmax_t;
69
+ typedef _ULonglong uintmax_t;
70
+
71
+ /* LIMIT MACROS */
72
+ #define INT8_MIN (-0x7f - _C2)
73
+ #define INT16_MIN (-0x7fff - _C2)
74
+ #define INT32_MIN (-0x7fffffff - _C2)
75
+
76
+ #define INT8_MAX 0x7f
77
+ #define INT16_MAX 0x7fff
78
+ #define INT32_MAX 0x7fffffff
79
+ #define UINT8_MAX 0xff
80
+ #define UINT16_MAX 0xffff
81
+ #define UINT32_MAX 0xffffffff
82
+
83
+ #define INT_LEAST8_MIN (-0x7f - _C2)
84
+ #define INT_LEAST16_MIN (-0x7fff - _C2)
85
+ #define INT_LEAST32_MIN (-0x7fffffff - _C2)
86
+
87
+ #define INT_LEAST8_MAX 0x7f
88
+ #define INT_LEAST16_MAX 0x7fff
89
+ #define INT_LEAST32_MAX 0x7fffffff
90
+ #define UINT_LEAST8_MAX 0xff
91
+ #define UINT_LEAST16_MAX 0xffff
92
+ #define UINT_LEAST32_MAX 0xffffffff
93
+
94
+ #define INT_FAST8_MIN (-0x7f - _C2)
95
+ #define INT_FAST16_MIN (-0x7fff - _C2)
96
+ #define INT_FAST32_MIN (-0x7fffffff - _C2)
97
+
98
+ #define INT_FAST8_MAX 0x7f
99
+ #define INT_FAST16_MAX 0x7fff
100
+ #define INT_FAST32_MAX 0x7fffffff
101
+ #define UINT_FAST8_MAX 0xff
102
+ #define UINT_FAST16_MAX 0xffff
103
+ #define UINT_FAST32_MAX 0xffffffff
104
+
105
+ #if _INTPTR == 0 || _INTPTR == 1
106
+ #define INTPTR_MAX 0x7fffffff
107
+ #define INTPTR_MIN (-INTPTR_MAX - _C2)
108
+ #define UINTPTR_MAX 0xffffffff
109
+
110
+ #else /* _INTPTR == 2 */
111
+ #define INTPTR_MIN (-_LLONG_MAX - _C2)
112
+ #define INTPTR_MAX _LLONG_MAX
113
+ #define UINTPTR_MAX _ULLONG_MAX
114
+ #endif /* _INTPTR */
115
+
116
+ #define INT8_C(x) (x)
117
+ #define INT16_C(x) (x)
118
+ #define INT32_C(x) ((x) + (INT32_MAX - INT32_MAX))
119
+
120
+ #define UINT8_C(x) (x)
121
+ #define UINT16_C(x) (x)
122
+ #define UINT32_C(x) ((x) + (UINT32_MAX - UINT32_MAX))
123
+
124
+ #ifdef _WIN64
125
+ #define PTRDIFF_MIN INT64_MIN
126
+ #define PTRDIFF_MAX INT64_MAX
127
+ #else /* _WIN64 */
128
+ #define PTRDIFF_MIN INT32_MIN
129
+ #define PTRDIFF_MAX INT32_MAX
130
+ #endif /* _WIN64 */
131
+
132
+ #define SIG_ATOMIC_MIN INT32_MIN
133
+ #define SIG_ATOMIC_MAX INT32_MAX
134
+
135
+ #ifndef SIZE_MAX
136
+ #ifdef _WIN64
137
+ #define SIZE_MAX UINT64_MAX
138
+ #else /* _WIN64 */
139
+ #define SIZE_MAX UINT32_MAX
140
+ #endif /* _WIN64 */
141
+ #endif /* SIZE_MAX */
142
+
143
+ #define WCHAR_MIN 0x0000
144
+ #define WCHAR_MAX 0xffff
145
+
146
+ #define WINT_MIN 0x0000
147
+ #define WINT_MAX 0xffff
148
+
149
+ #define INT64_MIN (-0x7fffffffffffffff - _C2)
150
+ #define INT64_MAX 0x7fffffffffffffff
151
+ #define UINT64_MAX 0xffffffffffffffffU
152
+
153
+ #define INT_LEAST64_MIN (-0x7fffffffffffffff - _C2)
154
+ #define INT_LEAST64_MAX 0x7fffffffffffffff
155
+ #define UINT_LEAST64_MAX 0xffffffffffffffffU
156
+
157
+ #define INT_FAST64_MIN (-0x7fffffffffffffff - _C2)
158
+ #define INT_FAST64_MAX 0x7fffffffffffffff
159
+ #define UINT_FAST64_MAX 0xffffffffffffffffU
160
+
161
+ #define INTMAX_MIN (-0x7fffffffffffffff - _C2)
162
+ #define INTMAX_MAX 0x7fffffffffffffff
163
+ #define UINTMAX_MAX 0xffffffffffffffffU
164
+
165
+ #define INT64_C(x) ((x) + (INT64_MAX - INT64_MAX))
166
+ #define UINT64_C(x) ((x) + (UINT64_MAX - UINT64_MAX))
167
+ #define INTMAX_C(x) INT64_C(x)
168
+ #define UINTMAX_C(x) UINT64_C(x)
169
+ _C_STD_END
170
+ #endif /* RC_INVOKED */
171
+ #endif /* _STDINT */
172
+
173
+ #if defined(_STD_USING)
174
+ using _CSTD int8_t; using _CSTD int16_t;
175
+ using _CSTD int32_t; using _CSTD int64_t;
176
+
177
+ using _CSTD uint8_t; using _CSTD uint16_t;
178
+ using _CSTD uint32_t; using _CSTD uint64_t;
179
+
180
+ using _CSTD int_least8_t; using _CSTD int_least16_t;
181
+ using _CSTD int_least32_t; using _CSTD int_least64_t;
182
+ using _CSTD uint_least8_t; using _CSTD uint_least16_t;
183
+ using _CSTD uint_least32_t; using _CSTD uint_least64_t;
184
+
185
+ using _CSTD intmax_t; using _CSTD uintmax_t;
186
+
187
+ using _CSTD uintptr_t;
188
+ using _CSTD intptr_t;
189
+
190
+ using _CSTD int_fast8_t; using _CSTD int_fast16_t;
191
+ using _CSTD int_fast32_t; using _CSTD int_fast64_t;
192
+ using _CSTD uint_fast8_t; using _CSTD uint_fast16_t;
193
+ using _CSTD uint_fast32_t; using _CSTD uint_fast64_t;
194
+ #endif /* defined(_STD_USING) */
195
+
196
+ /*
197
+ * Copyright (c) 1992-2009 by P.J. Plauger. ALL RIGHTS RESERVED.
198
+ * Consult your license regarding permissions and restrictions.
199
+ V5.20:0009 */