Browse Source

export symbols in test_cases

master
aaaaaa aaaaaaa 7 years ago
parent
commit
c7b6246025
8 changed files with 24 additions and 14 deletions
  1. +2
    -2
      test_cases/advanced_instructions.h
  2. +2
    -2
      test_cases/backwards.h
  3. +10
    -0
      test_cases/export.def
  4. +1
    -5
      test_cases/main.cpp
  5. +3
    -3
      test_cases/simple_tests.h
  6. +1
    -1
      test_cases/test_cases.h
  7. +4
    -1
      test_cases/test_cases.vcxproj
  8. +1
    -0
      test_cases/test_cases.vcxproj.filters

+ 2
- 2
test_cases/advanced_instructions.h View File

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

+ 2
- 2
test_cases/backwards.h View File

* @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
- 0
test_cases/export.def View File

LIBRARY test_cases
EXPORTS
SelfTest
_small
_branch
_rip_relative
_AVX
_loop
_tail_recursion
_RDRAND

+ 1
- 5
test_cases/main.cpp View File

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

+ 3
- 3
test_cases/simple_tests.h View File

/** /**
* 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
* *
* @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().
* 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);
}; };

+ 1
- 1
test_cases/test_cases.h View File

#include "backwards.h" #include "backwards.h"
#include "advanced_instructions.h" #include "advanced_instructions.h"


_declspec(dllexport) void SelfTest();
void SelfTest();

+ 4
- 1
test_cases/test_cases.vcxproj View File

</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>
<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>
<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>

+ 1
- 0
test_cases/test_cases.vcxproj.filters View File

<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">

Loading…
Cancel
Save