export symbols in test_cases

This commit is contained in:
2017-12-27 13:46:19 +01:00
parent 143200e0e6
commit c7b6246025
8 changed files with 24 additions and 14 deletions

View File

@@ -6,10 +6,10 @@ extern "C" {
* @param num: the number of which the square root shall be taken * @param num: the number of which the square root shall be taken
* @param res: where the 4 results shall be written * @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 * Just a wrapper around RDRAND
*/ */
uint32_t _declspec(dllexport) _RDRAND(void); uint32_t _RDRAND(void);
} }

View File

@@ -6,12 +6,12 @@ extern "C" {
* @param num * @param num
* @param cnt * @param cnt
*/ */
uint32_t _declspec(dllexport) _loop(uint32_t num, uint32_t cnt); uint32_t _loop(uint32_t num, uint32_t cnt);
/** /**
* Computes factorial * Computes factorial
* *
* @param x * @param x
*/ */
uint32_t _declspec(dllexport) _tail_recursion(uint32_t x); uint32_t _tail_recursion(uint32_t x);
} }

10
test_cases/export.def Normal file
View File

@@ -0,0 +1,10 @@
LIBRARY test_cases
EXPORTS
SelfTest
_small
_branch
_rip_relative
_AVX
_loop
_tail_recursion
_RDRAND

View File

@@ -1,14 +1,10 @@
#include <stdint.h> #include <cstdint>
#include <iostream> #include <iostream>
#define CATCH_CONFIG_RUNNER #define CATCH_CONFIG_RUNNER
#include "catch.hpp" #include "catch.hpp"
#include "test_cases.h" #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; static Catch::Session session;
_declspec(dllexport) void SelfTest() { _declspec(dllexport) void SelfTest() {

View File

@@ -3,7 +3,7 @@ extern "C" {
/** /**
* A small function, that always returns 0 * 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 * This function checks if the parameter is even or odd, and then
@@ -14,7 +14,7 @@ extern "C" {
* *
* @param Number to be checked * @param Number to be checked
*/ */
uint64_t _declspec(dllexport) _branch(uint64_t); uint64_t _branch(uint64_t);
/** /**
* Replicates the MSVCRT rand(). * Replicates the MSVCRT rand().
@@ -27,5 +27,5 @@ extern "C" {
* return( ((seed = seed * 214013L * return( ((seed = seed * 214013L
* + 2531011L) >> 16) & 0x7fff ); * + 2531011L) >> 16) & 0x7fff );
*/ */
uint64_t _declspec(dllexport) _rip_relative(void); uint64_t _rip_relative(void);
}; };

View File

@@ -3,4 +3,4 @@
#include "backwards.h" #include "backwards.h"
#include "advanced_instructions.h" #include "advanced_instructions.h"
_declspec(dllexport) void SelfTest(); void SelfTest();

View File

@@ -80,6 +80,7 @@
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental> <LinkIncremental>false</LinkIncremental>
<PreBuildEventUseInBuild>false</PreBuildEventUseInBuild>
</PropertyGroup> </PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile> <ClCompile>
@@ -144,9 +145,10 @@
<OptimizeReferences>true</OptimizeReferences> <OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>backwards.obj;simple_tests.obj;advanced_instructions.obj;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>backwards.obj;simple_tests.obj;advanced_instructions.obj;%(AdditionalDependencies)</AdditionalDependencies>
<ModuleDefinitionFile>export.def</ModuleDefinitionFile>
</Link> </Link>
<PreBuildEvent> <PreBuildEvent>
<Command>$(MSBuildProjectDirectory)\assemble.ps</Command> <Command>powershell "&amp;" assemble.ps1</Command>
</PreBuildEvent> </PreBuildEvent>
<PreBuildEvent> <PreBuildEvent>
<Message>Assemble all .asm files using FASM</Message> <Message>Assemble all .asm files using FASM</Message>
@@ -156,6 +158,7 @@
<None Include="advanced_instructions.asm" /> <None Include="advanced_instructions.asm" />
<None Include="assemble.ps1" /> <None Include="assemble.ps1" />
<None Include="backwards.asm" /> <None Include="backwards.asm" />
<None Include="export.def" />
<None Include="README.md" /> <None Include="README.md" />
<None Include="simple_tests.asm" /> <None Include="simple_tests.asm" />
</ItemGroup> </ItemGroup>

View File

@@ -28,6 +28,7 @@
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</None> </None>
<None Include="README.md" /> <None Include="README.md" />
<None Include="export.def" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="advanced_instructions.h"> <ClInclude Include="advanced_instructions.h">