summaryrefslogtreecommitdiff
path: root/Tests/VSNASM
diff options
context:
space:
mode:
authorEvgeny Fimochkin <fimochkin@gmail.com>2017-01-27 19:31:50 +0700
committerBrad King <brad.king@kitware.com>2017-02-07 13:20:52 -0500
commit5ba2c9e5e08cb391c366065210a95a46ac74f310 (patch)
tree649d1bbb4922c4a195f7284c5eee0aba51d3f004 /Tests/VSNASM
parent0f4dae0a4da92af5079eb730443ec188b3b46f8e (diff)
downloadcmake-5ba2c9e5e08cb391c366065210a95a46ac74f310.tar.gz
VS: Add support for ASM_NASM language
Fixes: #16469
Diffstat (limited to 'Tests/VSNASM')
-rw-r--r--Tests/VSNASM/CMakeLists.txt10
-rw-r--r--Tests/VSNASM/foo.asm7
-rw-r--r--Tests/VSNASM/include/foo-proc.asm7
-rw-r--r--Tests/VSNASM/main.c5
4 files changed, 29 insertions, 0 deletions
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();
+}