From c7b62460256a2284f3b2ebc2869bb2cb09719ca5 Mon Sep 17 00:00:00 2001 From: aaaaaa aaaaaaa Date: Wed, 27 Dec 2017 13:46:19 +0100 Subject: [PATCH] export symbols in test_cases --- test_cases/advanced_instructions.h | 4 ++-- test_cases/backwards.h | 4 ++-- test_cases/export.def | 10 ++++++++++ test_cases/main.cpp | 6 +----- test_cases/simple_tests.h | 6 +++--- test_cases/test_cases.h | 2 +- test_cases/test_cases.vcxproj | 5 ++++- test_cases/test_cases.vcxproj.filters | 1 + 8 files changed, 24 insertions(+), 14 deletions(-) create mode 100644 test_cases/export.def diff --git a/test_cases/advanced_instructions.h b/test_cases/advanced_instructions.h index c4659be..0a3d10f 100644 --- a/test_cases/advanced_instructions.h +++ b/test_cases/advanced_instructions.h @@ -6,10 +6,10 @@ extern "C" { * @param num: the number of which the square root shall be taken * @param res: where the 4 results shall be written */ - void _declspec(dllexport) _AVX(float num, void* res); + void _AVX(float num, void* res); /** * Just a wrapper around RDRAND */ - uint32_t _declspec(dllexport) _RDRAND(void); + uint32_t _RDRAND(void); } \ No newline at end of file diff --git a/test_cases/backwards.h b/test_cases/backwards.h index 24dcc4e..683e046 100644 --- a/test_cases/backwards.h +++ b/test_cases/backwards.h @@ -6,12 +6,12 @@ extern "C" { * @param num * @param cnt */ - uint32_t _declspec(dllexport) _loop(uint32_t num, uint32_t cnt); + uint32_t _loop(uint32_t num, uint32_t cnt); /** * Computes factorial * * @param x */ - uint32_t _declspec(dllexport) _tail_recursion(uint32_t x); + uint32_t _tail_recursion(uint32_t x); } \ No newline at end of file diff --git a/test_cases/export.def b/test_cases/export.def new file mode 100644 index 0000000..9b21024 --- /dev/null +++ b/test_cases/export.def @@ -0,0 +1,10 @@ +LIBRARY test_cases +EXPORTS +SelfTest +_small +_branch +_rip_relative +_AVX +_loop +_tail_recursion +_RDRAND \ No newline at end of file diff --git a/test_cases/main.cpp b/test_cases/main.cpp index 0285fb8..ca240a3 100644 --- a/test_cases/main.cpp +++ b/test_cases/main.cpp @@ -1,14 +1,10 @@ -#include +#include #include #define CATCH_CONFIG_RUNNER #include "catch.hpp" #include "test_cases.h" -/*#pragma comment(lib, "advanced_instructions.obj") -#pragma comment(lib, "simple_tests.obj") -#pragma comment(lib, "backwards.obj")*/ - static Catch::Session session; _declspec(dllexport) void SelfTest() { diff --git a/test_cases/simple_tests.h b/test_cases/simple_tests.h index 74b0059..c7a6744 100644 --- a/test_cases/simple_tests.h +++ b/test_cases/simple_tests.h @@ -3,7 +3,7 @@ extern "C" { /** * A small function, that always returns 0 */ - uint64_t _declspec(dllexport) _small(void); + uint64_t _small(void); /** * This function checks if the parameter is even or odd, and then @@ -14,7 +14,7 @@ extern "C" { * * @param Number to be checked */ - uint64_t _declspec(dllexport) _branch(uint64_t); + uint64_t _branch(uint64_t); /** * Replicates the MSVCRT rand(). @@ -27,5 +27,5 @@ extern "C" { * return( ((seed = seed * 214013L * + 2531011L) >> 16) & 0x7fff ); */ - uint64_t _declspec(dllexport) _rip_relative(void); + uint64_t _rip_relative(void); }; diff --git a/test_cases/test_cases.h b/test_cases/test_cases.h index 355ccb6..6b2af6d 100644 --- a/test_cases/test_cases.h +++ b/test_cases/test_cases.h @@ -3,4 +3,4 @@ #include "backwards.h" #include "advanced_instructions.h" -_declspec(dllexport) void SelfTest(); \ No newline at end of file +void SelfTest(); \ No newline at end of file diff --git a/test_cases/test_cases.vcxproj b/test_cases/test_cases.vcxproj index 4d59495..416d333 100644 --- a/test_cases/test_cases.vcxproj +++ b/test_cases/test_cases.vcxproj @@ -80,6 +80,7 @@ false + false @@ -144,9 +145,10 @@ true true backwards.obj;simple_tests.obj;advanced_instructions.obj;%(AdditionalDependencies) + export.def - $(MSBuildProjectDirectory)\assemble.ps + powershell "&" assemble.ps1 Assemble all .asm files using FASM @@ -156,6 +158,7 @@ + diff --git a/test_cases/test_cases.vcxproj.filters b/test_cases/test_cases.vcxproj.filters index 383c137..6e9ecce 100644 --- a/test_cases/test_cases.vcxproj.filters +++ b/test_cases/test_cases.vcxproj.filters @@ -28,6 +28,7 @@ Source Files +