Skip to content

Commit

Permalink
- AsmJit executables should have consistent prefix 'asmjit'.
Browse files Browse the repository at this point in the history
- Added 'char' to type-id for function argument to typeId conversion.
- Added asmjit_test_x86 to be called by continuous integration.
  • Loading branch information
kobalicek committed Feb 8, 2015
1 parent ba1c7ef commit de444b8
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 39 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down
File renamed without changes.
File renamed without changes.
9 changes: 6 additions & 3 deletions src/app/test/testx86.cpp → src/app/test/asmjit_test_x86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2518,7 +2518,7 @@ struct X86TestSuite {
PodVector<X86Test*> tests;
StringBuilder output;

int result;
int returnCode;
int binSize;
bool alwaysPrintLog;
};
Expand All @@ -2527,7 +2527,7 @@ struct X86TestSuite {
_Class_::add(tests)

X86TestSuite::X86TestSuite() :
result(EXIT_SUCCESS),
returnCode(0),
binSize(0),
alwaysPrintLog(false) {

Expand Down Expand Up @@ -2646,6 +2646,7 @@ int X86TestSuite::run() {
}

runtime.release(func);
returnCode = 1;
}
else {
if (!alwaysPrintLog) {
Expand All @@ -2655,6 +2656,8 @@ int X86TestSuite::run() {
fprintf(file, "-------------------------------------------------------------------------------\n");
fprintf(file, "[Failure] %s.\n", test->getName());
fprintf(file, "===============================================================================\n");

returnCode = 1;
}

fflush(file);
Expand All @@ -2664,7 +2667,7 @@ int X86TestSuite::run() {
fputs(output.getData(), file);
fflush(file);

return result;
return returnCode;
}

// ============================================================================
Expand Down
58 changes: 25 additions & 33 deletions src/asmjit/base/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -1174,7 +1174,7 @@ struct DoubleType {};
#if !defined(ASMJIT_DOCGEN)
template<typename T>
struct TypeId {
enum { kId = static_cast<int>(::asmjit::kInvalidVar) };
// Left empty to report any type, which is not known to asmjit.
};

template<typename T>
Expand All @@ -1186,38 +1186,30 @@ struct TypeId<T*> {
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<char>::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

// ============================================================================
Expand Down

0 comments on commit de444b8

Please sign in to comment.