From 5ba2c9e5e08cb391c366065210a95a46ac74f310 Mon Sep 17 00:00:00 2001 From: Evgeny Fimochkin Date: Fri, 27 Jan 2017 19:31:50 +0700 Subject: VS: Add support for ASM_NASM language Fixes: #16469 --- Tests/VSNASM/CMakeLists.txt | 10 ++++++++++ Tests/VSNASM/foo.asm | 7 +++++++ Tests/VSNASM/include/foo-proc.asm | 7 +++++++ Tests/VSNASM/main.c | 5 +++++ 4 files changed, 29 insertions(+) create mode 100644 Tests/VSNASM/CMakeLists.txt create mode 100644 Tests/VSNASM/foo.asm create mode 100644 Tests/VSNASM/include/foo-proc.asm create mode 100644 Tests/VSNASM/main.c (limited to 'Tests/VSNASM') diff --git a/Tests/VSNASM/CMakeLists.txt b/Tests/VSNASM/CMakeLists.txt new file mode 100644 index 0000000000..c2e29df257 --- /dev/null +++ b/Tests/VSNASM/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 2.8.12) +project(VSNASM C ASM_NASM) +if(CMAKE_SIZEOF_VOID_P EQUAL 8) + add_definitions(-DTESTx64) + string(APPEND CMAKE_ASM_NASM_FLAGS " -DTEST2x64") +else() + add_definitions(-DTESTi386) +endif() +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) +add_executable(VSNASM main.c foo.asm) diff --git a/Tests/VSNASM/foo.asm b/Tests/VSNASM/foo.asm new file mode 100644 index 0000000000..aba0673c01 --- /dev/null +++ b/Tests/VSNASM/foo.asm @@ -0,0 +1,7 @@ +section .text +%ifdef TEST2x64 +global foo +%else +global _foo +%endif +%include "foo-proc.asm" diff --git a/Tests/VSNASM/include/foo-proc.asm b/Tests/VSNASM/include/foo-proc.asm new file mode 100644 index 0000000000..450a7919b5 --- /dev/null +++ b/Tests/VSNASM/include/foo-proc.asm @@ -0,0 +1,7 @@ +%ifdef TESTx64 +foo: +%else +_foo: +%endif + mov eax, 0 + ret diff --git a/Tests/VSNASM/main.c b/Tests/VSNASM/main.c new file mode 100644 index 0000000000..18ddb7826f --- /dev/null +++ b/Tests/VSNASM/main.c @@ -0,0 +1,5 @@ +extern int foo(void); +int main(void) +{ + return foo(); +} -- cgit v1.2.1