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 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);
}

View File

@@ -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);
}

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>
#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() {

View File

@@ -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);
};

View File

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

View File

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

View File

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