diff --git a/.travis.yml b/.travis.yml index 2aee7d06..607204b0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,6 +33,9 @@ script: - ./build_dbg/asmjit_test - ./build_rel/asmjit_test + - ./build_dbg/asmjit_test_x86 + - ./build_rel/asmjit_test_x86 + after_success: - valgrind --leak-check=full --show-reachable=yes ./build_dbg/asmjit_test - valgrind --leak-check=full --show-reachable=yes ./build_rel/asmjit_test diff --git a/CMakeLists.txt b/CMakeLists.txt index 39064baa..8ee62f75 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -353,9 +353,9 @@ EndIf() If(ASMJIT_BUILD_SAMPLES) Set(ASMJIT_SRC_SAMPLES - benchx86 - testopcode - testx86 + asmjit_bench_x86 + asmjit_test_opcode + asmjit_test_x86 ) ForEach(file ${ASMJIT_SRC_SAMPLES}) diff --git a/src/app/test/benchx86.cpp b/src/app/test/asmjit_bench_x86.cpp similarity index 100% rename from src/app/test/benchx86.cpp rename to src/app/test/asmjit_bench_x86.cpp diff --git a/src/app/test/testopcode.cpp b/src/app/test/asmjit_test_opcode.cpp similarity index 100% rename from src/app/test/testopcode.cpp rename to src/app/test/asmjit_test_opcode.cpp diff --git a/src/app/test/testx86.cpp b/src/app/test/asmjit_test_x86.cpp similarity index 99% rename from src/app/test/testx86.cpp rename to src/app/test/asmjit_test_x86.cpp index ee1940fb..a75ad1aa 100644 --- a/src/app/test/testx86.cpp +++ b/src/app/test/asmjit_test_x86.cpp @@ -2518,7 +2518,7 @@ struct X86TestSuite { PodVector tests; StringBuilder output; - int result; + int returnCode; int binSize; bool alwaysPrintLog; }; @@ -2527,7 +2527,7 @@ struct X86TestSuite { _Class_::add(tests) X86TestSuite::X86TestSuite() : - result(EXIT_SUCCESS), + returnCode(0), binSize(0), alwaysPrintLog(false) { @@ -2646,6 +2646,7 @@ int X86TestSuite::run() { } runtime.release(func); + returnCode = 1; } else { if (!alwaysPrintLog) { @@ -2655,6 +2656,8 @@ int X86TestSuite::run() { fprintf(file, "-------------------------------------------------------------------------------\n"); fprintf(file, "[Failure] %s.\n", test->getName()); fprintf(file, "===============================================================================\n"); + + returnCode = 1; } fflush(file); @@ -2664,7 +2667,7 @@ int X86TestSuite::run() { fputs(output.getData(), file); fflush(file); - return result; + return returnCode; } // ============================================================================ diff --git a/src/asmjit/base/compiler.h b/src/asmjit/base/compiler.h index 5b663baf..ea621715 100644 --- a/src/asmjit/base/compiler.h +++ b/src/asmjit/base/compiler.h @@ -1174,7 +1174,7 @@ struct DoubleType {}; #if !defined(ASMJIT_DOCGEN) template struct TypeId { - enum { kId = static_cast(::asmjit::kInvalidVar) }; + // Left empty to report any type, which is not known to asmjit. }; template @@ -1186,38 +1186,30 @@ struct TypeId { template<> \ struct TypeId<_T_> { enum { kId = _Id_ }; } -ASMJIT_TYPE_ID(void, kInvalidVar); -ASMJIT_TYPE_ID(Void, kInvalidVar); - -ASMJIT_TYPE_ID(int8_t, kVarTypeInt8); -ASMJIT_TYPE_ID(Int8Type, kVarTypeInt8); - -ASMJIT_TYPE_ID(uint8_t, kVarTypeUInt8); -ASMJIT_TYPE_ID(UInt8Type, kVarTypeUInt8); - -ASMJIT_TYPE_ID(int16_t, kVarTypeInt16); -ASMJIT_TYPE_ID(Int16Type, kVarTypeInt16); - -ASMJIT_TYPE_ID(uint16_t, kVarTypeUInt8); -ASMJIT_TYPE_ID(UInt16Type, kVarTypeUInt8); - -ASMJIT_TYPE_ID(int32_t, kVarTypeInt32); -ASMJIT_TYPE_ID(Int32Type, kVarTypeUInt8); - -ASMJIT_TYPE_ID(uint32_t, kVarTypeUInt32); -ASMJIT_TYPE_ID(UInt32Type, kVarTypeUInt8); - -ASMJIT_TYPE_ID(int64_t, kVarTypeInt64); -ASMJIT_TYPE_ID(Int64Type, kVarTypeUInt8); - -ASMJIT_TYPE_ID(uint64_t, kVarTypeUInt64); -ASMJIT_TYPE_ID(UInt64Type, kVarTypeUInt8); - -ASMJIT_TYPE_ID(float, kVarTypeFp32); -ASMJIT_TYPE_ID(FloatType, kVarTypeFp32); - -ASMJIT_TYPE_ID(double, kVarTypeFp64); -ASMJIT_TYPE_ID(DoubleType, kVarTypeFp64); +ASMJIT_TYPE_ID(void , kInvalidVar); +ASMJIT_TYPE_ID(char , IntTraits::kIsSigned ? kVarTypeInt8 : kVarTypeUInt8); +ASMJIT_TYPE_ID(signed char , kVarTypeInt8); +ASMJIT_TYPE_ID(unsigned char, kVarTypeUInt8); +ASMJIT_TYPE_ID(int16_t , kVarTypeInt16); +ASMJIT_TYPE_ID(uint16_t , kVarTypeUInt16); +ASMJIT_TYPE_ID(int32_t , kVarTypeInt32); +ASMJIT_TYPE_ID(uint32_t , kVarTypeUInt32); +ASMJIT_TYPE_ID(int64_t , kVarTypeInt64); +ASMJIT_TYPE_ID(uint64_t , kVarTypeUInt64); +ASMJIT_TYPE_ID(float , kVarTypeFp32); +ASMJIT_TYPE_ID(double , kVarTypeFp64); + +ASMJIT_TYPE_ID(Void , kInvalidVar); +ASMJIT_TYPE_ID(Int8Type , kVarTypeInt8); +ASMJIT_TYPE_ID(UInt8Type , kVarTypeUInt8); +ASMJIT_TYPE_ID(Int16Type , kVarTypeInt16); +ASMJIT_TYPE_ID(UInt16Type , kVarTypeUInt16); +ASMJIT_TYPE_ID(Int32Type , kVarTypeUInt32); +ASMJIT_TYPE_ID(UInt32Type , kVarTypeUInt32); +ASMJIT_TYPE_ID(Int64Type , kVarTypeUInt64); +ASMJIT_TYPE_ID(UInt64Type , kVarTypeUInt64); +ASMJIT_TYPE_ID(FloatType , kVarTypeFp32); +ASMJIT_TYPE_ID(DoubleType , kVarTypeFp64); #endif // !ASMJIT_DOCGEN // ============================================================================