[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[cinvoke-svn] r111 - in trunk/cinvoke: lib/arch test
From: |
will |
Subject: |
[cinvoke-svn] r111 - in trunk/cinvoke: lib/arch test |
Date: |
24 Aug 2006 11:11:43 -0400 |
Author: will
Date: 2006-08-24 11:11:42 -0400 (Thu, 24 Aug 2006)
New Revision: 111
Modified:
trunk/cinvoke/lib/arch/gcc_sparc_unix.c
trunk/cinvoke/lib/arch/gcc_sparc_unix.h
trunk/cinvoke/test/lib.c
trunk/cinvoke/test/runtests.c
Log:
all tests pass
Modified: trunk/cinvoke/lib/arch/gcc_sparc_unix.c
===================================================================
--- trunk/cinvoke/lib/arch/gcc_sparc_unix.c 2006-08-22 19:02:34 UTC (rev
110)
+++ trunk/cinvoke/lib/arch/gcc_sparc_unix.c 2006-08-24 15:11:42 UTC (rev
111)
@@ -125,13 +125,12 @@
memcpy(ret,
"\x9d\xe3\xbf\x90\x8a\x10\x00\x18"
"\x92\x10\x00\x19\x94\x10\x00\x1a"
- "\x96\x10\x00\x1b\x99\x10\x00\x1c"
- "\x9a\x10\x00\x1d"
- "\x03\x2a\xaa\xae\x9a\x10\x63\xbb"
- "\x03\x33\x33\x37\x90\x10\x61\xdd"
- "\x9f\xc3\x40\x00\x01\x00\x00\x00"
- "\x01\x00\x00\x00\x81\xc7\xe0\x08"
- "\x81\xe8\x00\x00",
+ "\x96\x10\x00\x1b\x98\x10\x00\x1c"
+ "\x9a\x10\x00\x1d\x03\x2a\xaa\xae"
+ "\xa0\x10\x63\xbb\x03\x33\x33\x37"
+ "\x90\x10\x61\xdd\x9f\xc4\x00\x00"
+ "\x01\x00\x00\x00\x01\x00\x00\x00"
+ "\x81\xc7\xe0\x08\x81\xe8\x00\x00",
64);
copy_hi(ret + 28, functionphi);
copy_lo(ret + 34, functionplo);
@@ -226,6 +225,9 @@
if (index < 5) {
*(long long *)po = ((long long)*toget[index]) << 32;
*(long long *)po |= *toget[index + 1];
+ } else {
+ *(long long *)po &= 0xFFFFFFFF;
+ *(long long *)po |= ((long long)*toget[index]) << 32;
}
break;
case CINV_T_FLOAT:
Modified: trunk/cinvoke/lib/arch/gcc_sparc_unix.h
===================================================================
--- trunk/cinvoke/lib/arch/gcc_sparc_unix.h 2006-08-22 19:02:34 UTC (rev
110)
+++ trunk/cinvoke/lib/arch/gcc_sparc_unix.h 2006-08-24 15:11:42 UTC (rev
111)
@@ -146,7 +146,7 @@
#define ARCH_GET_FRAME_PTR(fp) \
__asm__("st %%fp, %0" : "=m" (fp));
-#define ARCH_CALLBACK_ARG_OFFSET (392) // XXX
+#define ARCH_CALLBACK_ARG_OFFSET (180);
#define ARCH_BIG_ENDIAN 1
Modified: trunk/cinvoke/test/lib.c
===================================================================
--- trunk/cinvoke/test/lib.c 2006-08-22 19:02:34 UTC (rev 110)
+++ trunk/cinvoke/test/lib.c 2006-08-24 15:11:42 UTC (rev 111)
@@ -71,14 +71,14 @@
return -5;
}
DLLEXPORT void test9(float (CDECL *f)(int, char, int)) {
- printf("test9: %f (want 11.0)\n", f(22, 'A', 44));
+ printf("test9: %f (want %f)\n", f(22, 'A', 44), 11.5);
}
DLLEXPORT float test10(int i1, short i2, char i3, long i4, long i5,
int i6, int i7, long i8, short i9) {
printf("test10: %d %d %c %ld %ld %d %d %ld %d (want 111 222 3 444 555
666 777 888 999)\n", i1, i2, i3, i4, i5, i6, i7, i8, i9);
return 0.7f;
}
-DLLEXPORT void test11(int (CDECL *f)(int, int, long, long, int, int,
+DLLEXPORT void test11(int (CDECL *f)(int, int, long, long, int, long long,
int, long long)) {
- printf("test11: %d (want 1)\n", f(1, 2, 3, 4, 5, 6, 0x77777777,
0x88888888888888LL));
+ printf("test11: %d (want 1)\n", f(1, 2, 3, 4, 5, 0x66666666666666LL,
0x77777777, 0x88888888888888LL));
}
Modified: trunk/cinvoke/test/runtests.c
===================================================================
--- trunk/cinvoke/test/runtests.c 2006-08-22 19:02:34 UTC (rev 110)
+++ trunk/cinvoke/test/runtests.c 2006-08-24 15:11:42 UTC (rev 111)
@@ -268,7 +268,7 @@
printf("userdata=%p (want 0xAA)\n", userdata);
printf("args=%d %c %d (want 22 A 44)\n", *(int*)parameters[0],
*(char*)parameters[1],
*(int*)parameters[2]);
- *(float *)returnout = 11.0f;
+ *(float *)returnout = 11.5f;
}
int test9(CInvContext *ctx, CInvLibrary *lib, void *ep,
@@ -321,27 +321,28 @@
void cbfunc2(CInvFunction *f, void *parameters[], void *returnout,
void *userdata) {
#ifdef _WIN32
- char buf[20];
- _i64toa(*(long long *)parameters[7], buf, 16);
- printf("args=%d %d %ld %ld %d %d %x %s"
+ char buf1[20], buf2[20];
+ _i64toa(*(long long *)parameters[5], buf1, 16);
+ _i64toa(*(long long *)parameters[7], buf2, 16);
+ printf("args=%d %d %ld %ld %d %s %x %s"
" (want 1 2 3 4 5 6 77777777 88888888888888)\n",
*(int *)parameters[0],
*(int *)parameters[1],
*(long *)parameters[2],
*(long *)parameters[3],
*(int *)parameters[4],
- *(int *)parameters[5],
+ buf1,
*(int *)parameters[6],
- buf);
+ buf2);
#else
- printf("args=%d %d %ld %ld %d %d %x %llx"
- " (want 1 2 3 4 5 6 77777777 88888888888888)\n",
+ printf("args=%d %d %ld %ld %d %llx %x %llx"
+ " (want 1 2 3 4 5 66666666666666 77777777 88888888888888)\n",
*(int *)parameters[0],
*(int *)parameters[1],
*(long *)parameters[2],
*(long *)parameters[3],
*(int *)parameters[4],
- *(int *)parameters[5],
+ *(long long *)parameters[5],
*(int *)parameters[6],
*(long long *)parameters[7]);
#endif
@@ -352,7 +353,7 @@
int test11(CInvContext *ctx, CInvLibrary *lib, void *ep,
CInvFunction *f) {
CInvFunction *proto = cinv_function_create(ctx, CINV_CC_DEFAULT, "i",
- "iilliiie");
+ "iillieie");
CInvCallback *cb = cinv_callback_create(ctx, proto, (void *)0xBB,
cbfunc2);
void *e = cinv_callback_getentrypoint(ctx, cb);
@@ -438,7 +439,7 @@
UPDATE0(test8);
UPDATE(test9, "", "p");
UPDATE(test10, "f", "isclliils");
- SKIP_UPDATE(test11, "", "p");
+ UPDATE(test11, "", "p");
if (!cinv_library_delete(ctx, lib)) {
fprintf(stderr, "Error deleting library: %s\n",
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [cinvoke-svn] r111 - in trunk/cinvoke: lib/arch test,
will <=