2009-06-16 Andrew Haley <aph@redhat.com> * testsuite/libffi.call/cls_align_sint64.c, testsuite/libffi.call/cls_align_uint64.c, testsuite/libffi.call/cls_longdouble_va.c, testsuite/libffi.call/cls_ulonglong.c, testsuite/libffi.call/return_ll1.c, testsuite/libffi.call/stret_medium2.c: Fix printf format specifiers. * testsuite/libffi.call/huge_struct.c: Ad x86 XFAILs. * testsuite/libffi.call/float2.c: Fix dg-excess-errors. * testsuite/libffi.call/ffitest.h, testsuite/libffi.special/ffitestcxx.h (PRIdLL, PRIuLL): Define.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245
diff --git a/libffi/ChangeLog.libffi b/libffi/ChangeLog.libffi
index 3fc5b5e..af08bdf 100644
--- a/libffi/ChangeLog.libffi
+++ b/libffi/ChangeLog.libffi
@@ -1,6 +1,20 @@
+2009-06-16 Andrew Haley <aph@redhat.com>
+
+ * testsuite/libffi.call/cls_align_sint64.c,
+ testsuite/libffi.call/cls_align_uint64.c,
+ testsuite/libffi.call/cls_longdouble_va.c,
+ testsuite/libffi.call/cls_ulonglong.c,
+ testsuite/libffi.call/return_ll1.c,
+ testsuite/libffi.call/stret_medium2.c: Fix printf format
+ specifiers.
+ * testsuite/libffi.call/huge_struct.c: Ad x86 XFAILs.
+ * testsuite/libffi.call/float2.c: Fix dg-excess-errors.
+ * testsuite/libffi.call/ffitest.h,
+ testsuite/libffi.special/ffitestcxx.h (PRIdLL, PRIuLL): Define.
+
2009-06-12 Andrew Haley <aph@redhat.com>
- * ChangeLog.libffi: testsuite/libffi.call/cls_align_sint64.c,
+ * testsuite/libffi.call/cls_align_sint64.c,
testsuite/libffi.call/cls_align_uint64.c,
testsuite/libffi.call/cls_ulonglong.c,
testsuite/libffi.call/return_ll1.c,
diff --git a/libffi/testsuite/libffi.call/cls_align_sint64.c b/libffi/testsuite/libffi.call/cls_align_sint64.c
index d8b73e9..2b15c98 100644
--- a/libffi/testsuite/libffi.call/cls_align_sint64.c
+++ b/libffi/testsuite/libffi.call/cls_align_sint64.c
@@ -22,7 +22,7 @@ cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
result.b = a1.b + a2.b;
result.c = a1.c + a2.c;
- printf("%d %lld %d %d %lld %d: %d %lld %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c);
+ printf("%d %" PRIdLL " %d %d %" PRIdLL " %d: %d %" PRIdLL " %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c);
return result;
}
@@ -77,14 +77,14 @@ int main (void)
ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl);
/* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */
- printf("res: %d %lld %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+ printf("res: %d %" PRIdLL " %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
/* { dg-output "\nres: 13 14271 140" } */
CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK);
res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(code))(g_dbl, f_dbl);
/* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */
- printf("res: %d %lld %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+ printf("res: %d %" PRIdLL " %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
/* { dg-output "\nres: 13 14271 140" } */
exit(0);
diff --git a/libffi/testsuite/libffi.call/cls_align_uint64.c b/libffi/testsuite/libffi.call/cls_align_uint64.c
index a3886f4..215584f 100644
--- a/libffi/testsuite/libffi.call/cls_align_uint64.c
+++ b/libffi/testsuite/libffi.call/cls_align_uint64.c
@@ -23,7 +23,7 @@ cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
result.b = a1.b + a2.b;
result.c = a1.c + a2.c;
- printf("%d %llu %d %d %llu %d: %d %llu %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c);
+ printf("%d %" PRIdLL " %d %d %" PRIdLL " %d: %d %" PRIdLL " %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c);
return result;
}
@@ -78,14 +78,14 @@ int main (void)
ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl);
/* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */
- printf("res: %d %llu %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+ printf("res: %d %" PRIdLL " %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
/* { dg-output "\nres: 13 14271 140" } */
CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK);
res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(code))(g_dbl, f_dbl);
/* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */
- printf("res: %d %llu %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+ printf("res: %d %" PRIdLL " %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
/* { dg-output "\nres: 13 14271 140" } */
exit(0);
diff --git a/libffi/testsuite/libffi.call/cls_longdouble_va.c b/libffi/testsuite/libffi.call/cls_longdouble_va.c
index 0e910d5..3d725bd 100644
--- a/libffi/testsuite/libffi.call/cls_longdouble_va.c
+++ b/libffi/testsuite/libffi.call/cls_longdouble_va.c
@@ -42,9 +42,9 @@ int main (void)
args[2] = NULL;
ffi_call(&cif, FFI_FN(printf), &res, args);
- // { dg-output "7.0" { xfail i*86-*-linux-* x86_64-*-linux-* sh*-*-linux-* } }
+ // { dg-output "7.0" { xfail i*86-*-linux-* x86_64-*-linux-* } }
printf("res: %d\n", (int) res);
- // { dg-output "\nres: 4" { xfail i*86-*-linux-* x86_64-*-linux-* sh*-*-linux-* } }
+ // { dg-output "\nres: 4" { xfail i*86-*-linux-* x86_64-*-linux-* } }
CHECK(ffi_prep_closure_loc(pcl, &cif, cls_longdouble_va_fn, NULL, code) == FFI_OK);
diff --git a/libffi/testsuite/libffi.call/cls_ulonglong.c b/libffi/testsuite/libffi.call/cls_ulonglong.c
index ed891e3..c3cf0d6 100644
--- a/libffi/testsuite/libffi.call/cls_ulonglong.c
+++ b/libffi/testsuite/libffi.call/cls_ulonglong.c
@@ -12,7 +12,7 @@ static void cls_ret_ulonglong_fn(ffi_cif* cif __UNUSED__, void* resp,
{
*(unsigned long long *)resp= *(unsigned long long *)args[0];
- printf("%llu: %llu\n",*(unsigned long long *)args[0],
+ printf("%" PRIuLL ": %" PRIuLL "\n",*(unsigned long long *)args[0],
*(unsigned long long *)(resp));
}
typedef unsigned long long (*cls_ret_ulonglong)(unsigned long long);
@@ -34,12 +34,12 @@ int main (void)
CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_ulonglong_fn, NULL, code) == FFI_OK);
res = (*((cls_ret_ulonglong)code))(214LL);
/* { dg-output "214: 214" } */
- printf("res: %llu\n", res);
+ printf("res: %" PRIdLL "\n", res);
/* { dg-output "\nres: 214" } */
res = (*((cls_ret_ulonglong)code))(9223372035854775808LL);
/* { dg-output "\n9223372035854775808: 9223372035854775808" } */
- printf("res: %llu\n", res);
+ printf("res: %" PRIdLL "\n", res);
/* { dg-output "\nres: 9223372035854775808" } */
exit(0);
diff --git a/libffi/testsuite/libffi.call/ffitest.h b/libffi/testsuite/libffi.call/ffitest.h
index 8a437e4..c7cb76c 100644
--- a/libffi/testsuite/libffi.call/ffitest.h
+++ b/libffi/testsuite/libffi.call/ffitest.h
@@ -45,6 +45,15 @@
#endif
+/* MinGW kludge. */
+#ifdef WIN64
+#define PRIdLL "PRId64"
+#define PRIuLL "PRIu64"
+#else
+#define PRIdLL "lld"
+#define PRIuLL "llu"
+#endif
+
#ifdef USING_MMAP
static inline void *
allocate_mmap (size_t size)
diff --git a/libffi/testsuite/libffi.call/float2.c b/libffi/testsuite/libffi.call/float2.c
index f2b2f72..7ee9f45 100644
--- a/libffi/testsuite/libffi.call/float2.c
+++ b/libffi/testsuite/libffi.call/float2.c
@@ -4,7 +4,7 @@
PR: none.
Originator: From the original ffitest.c */
-/* { dg-excess-errors { target x86_64-*-mingw* x86_64-*-cygwin* } } */
+/* { dg-excess-errors "" { target x86_64-*-mingw* x86_64-*-cygwin* } } */
/* { dg-do run { xfail x86_64-*-mingw* x86_64-*-cygwin* } } */
#include "ffitest.h"
diff --git a/libffi/testsuite/libffi.call/huge_struct.c b/libffi/testsuite/libffi.call/huge_struct.c
index 7101110..85239d8 100644
--- a/libffi/testsuite/libffi.call/huge_struct.c
+++ b/libffi/testsuite/libffi.call/huge_struct.c
@@ -5,10 +5,10 @@
Originator: Blake Chaffin 6/18/2007
*/
-/* { dg-excess-errors { target x86_64-*-mingw* x86_64-*-cygwin* } } */
+/* { dg-excess-errors "" { target x86_64-*-mingw* x86_64-*-cygwin* i*86-*-linux-* x86_64-*-linux-* } } */
/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
/* { dg-options -mlong-double-128 { target powerpc64*-*-* } } */
-/* { dg-output "" { xfail x86_64-*-mingw* x86_64-*-cygwin* } } */
+/* { dg-output "" { xfail x86_64-*-mingw* x86_64-*-cygwin* i*86-*-linux-* x86_64-*-linux-* } } */
#include <stdint.h>
diff --git a/libffi/testsuite/libffi.call/return_ll1.c b/libffi/testsuite/libffi.call/return_ll1.c
index 5681d84..dad90c1 100644
--- a/libffi/testsuite/libffi.call/return_ll1.c
+++ b/libffi/testsuite/libffi.call/return_ll1.c
@@ -36,7 +36,7 @@ int main (void)
ll2 = 11111111;
ffi_call(&cif, FFI_FN(return_ll), &rlonglong, values);
- printf("res: %lld, %lld\n", rlonglong, ll0 + ll1 + ll2);
+ printf("res: %" PRIdLL ", %" PRIdLL "\n", rlonglong, ll0 + ll1 + ll2);
/* { dg-output "res: 11111133333222, 11111133333222" } */
exit(0);
}
diff --git a/libffi/testsuite/libffi.call/stret_medium2.c b/libffi/testsuite/libffi.call/stret_medium2.c
index 43703b2..a012f9e 100644
--- a/libffi/testsuite/libffi.call/stret_medium2.c
+++ b/libffi/testsuite/libffi.call/stret_medium2.c
@@ -39,7 +39,7 @@ struct_72byte cls_struct_72byte_fn(
result.h = b0.h + b1.h + b2.h + b3.h;
result.i = b0.i + b1.i + b2.i + b3.i;
- printf("%g %g %g %g %g %g %g %g %lld\n", result.a, result.b, result.c,
+ printf("%g %g %g %g %g %g %g %g %" PRIdLL "\n", result.a, result.b, result.c,
result.d, result.e, result.f, result.g, result.h, result.i);
return result;
@@ -107,7 +107,7 @@ int main (void)
ffi_call(&cif, FFI_FN(cls_struct_72byte_fn), &res_dbl, args_dbl);
/* { dg-output "22 15 17 25 6 13 19 18 16" } */
- printf("res: %g %g %g %g %g %g %g %g %lld\n", res_dbl.a, res_dbl.b, res_dbl.c,
+ printf("res: %g %g %g %g %g %g %g %g %" PRIdLL "\n", res_dbl.a, res_dbl.b, res_dbl.c,
res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g, res_dbl.h, res_dbl.i);
/* { dg-output "\nres: 22 15 17 25 6 13 19 18 16" } */
@@ -116,7 +116,7 @@ int main (void)
res_dbl = ((struct_72byte(*)(struct_72byte, struct_72byte,
struct_72byte, struct_72byte))(code))(e_dbl, f_dbl, g_dbl, h_dbl);
/* { dg-output "\n22 15 17 25 6 13 19 18 16" } */
- printf("res: %g %g %g %g %g %g %g %g %lld\n", res_dbl.a, res_dbl.b, res_dbl.c,
+ printf("res: %g %g %g %g %g %g %g %g %" PRIdLL "\n", res_dbl.a, res_dbl.b, res_dbl.c,
res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g, res_dbl.h, res_dbl.i);
/* { dg-output "\nres: 22 15 17 25 6 13 19 18 16" } */
diff --git a/libffi/testsuite/libffi.special/ffitestcxx.h b/libffi/testsuite/libffi.special/ffitestcxx.h
index b9f0d48..92fb656 100644
--- a/libffi/testsuite/libffi.special/ffitestcxx.h
+++ b/libffi/testsuite/libffi.special/ffitestcxx.h
@@ -43,6 +43,16 @@
#endif
+
+/* MinGW kludge. */
+#ifdef WIN64
+#define PRIdLL "PRId64"
+#define PRIuLL "PRIu64"
+#else
+#define PRIdLL "lld"
+#define PRIuLL "llu"
+#endif
+
#ifdef USING_MMAP
static inline void *
allocate_mmap (size_t size)