diff --git a/src/common.h b/src/common.h index 7e1f94e93b..10690c6046 100644 --- a/src/common.h +++ b/src/common.h @@ -31,14 +31,18 @@ #if (defined __i386__) || (defined __POWERPC__) || (defined __arm__) # define LD "ld" -# define LLD "lld" -#ifdef __APPLE__ -# define ULD "lu" -# define LX "lx" -#else -# define LX "x" -# define ULD "u" -#endif +# ifdef __MINGW32__ +# define LLD "I64d" +# else +# define LLD "lld" +# endif +# ifdef __APPLE__ +# define ULD "lu" +# define LX "lx" +# else +# define LX "x" +# define ULD "u" +# endif #elif defined __x86_64__ # ifdef __MINGW32__ # define LD "I64d" diff --git a/src/compile.cpp b/src/compile.cpp index ff6f15a5a6..add06d4845 100644 --- a/src/compile.cpp +++ b/src/compile.cpp @@ -189,8 +189,10 @@ compareIpToMethodBounds(Thread* t, intptr_t ip, object method) intptr_t start = methodCompiled(t, method); if (DebugMethodTree) { - fprintf(stderr, "find 0x%"LX" in (0x%"LX",0x%"LX")\n", ip, start, - start + compiledSize(start)); + fprintf(stderr, "find %p in (%p,%p)\n", + reinterpret_cast(ip), + reinterpret_cast(start), + reinterpret_cast(start + compiledSize(start))); } if (ip < start) { diff --git a/src/x86.cpp b/src/x86.cpp index 59959a2ce9..1854a01427 100644 --- a/src/x86.cpp +++ b/src/x86.cpp @@ -895,7 +895,7 @@ moveRR(Context* c, unsigned aSize, Assembler::Register* a, case 4: if (bSize == 8) { if (BytesPerWord == 8) { - alwaysRex(c, aSize, b, a); + alwaysRex(c, bSize, b, a); opcode(c, 0x63); modrm(c, 0xc0, a, b); } else { diff --git a/test/Longs.java b/test/Longs.java index daa6966677..51fad92969 100644 --- a/test/Longs.java +++ b/test/Longs.java @@ -35,7 +35,13 @@ public class Longs { return a - (a % b); } + private static int negativeOne() { + return -1; + } + public static void main(String[] args) { + expect(((long) negativeOne()) == -1); + { long foo = 25214903884L; int radix = 10; expect(foo > 0); diff --git a/test/test.sh b/test/test.sh index fd028e39f0..55b4ff54a6 100644 --- a/test/test.sh +++ b/test/test.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh log=build/log.txt vg="nice valgrind --leak-check=full --num-callers=32 \ @@ -28,7 +28,7 @@ for test in ${tests}; do exit 1;; esac - if (( ${?} == 0 )); then + if [ "${?}" = "0" ]; then echo "success" else echo "fail"