Bläddra i källkod

export symbols in test_cases

master
aaaaaa aaaaaaa 7 år sedan
förälder
incheckning
c7b6246025
8 ändrade filer med 24 tillägg och 14 borttagningar
  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 Visa fil

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

+ 2
- 2
test_cases/backwards.h Visa fil

@@ -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
- 0
test_cases/export.def Visa fil

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

+ 1
- 5
test_cases/main.cpp Visa fil

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

+ 3
- 3
test_cases/simple_tests.h Visa fil

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

+ 1
- 1
test_cases/test_cases.h Visa fil

@@ -3,4 +3,4 @@
#include "backwards.h"
#include "advanced_instructions.h"

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

+ 4
- 1
test_cases/test_cases.vcxproj Visa fil

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

+ 1
- 0
test_cases/test_cases.vcxproj.filters Visa fil

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

Laddar…
Avbryt
Spara