aboutsummaryrefslogtreecommitdiff
path: root/test cases
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2022-10-14 15:32:50 -0400
committerXavier Claessens <xclaesse@gmail.com>2022-10-24 14:52:13 +0200
commit942aea230f5e517d5add194240c8943f28d79943 (patch)
treeef4af65b83d089b084e8d051c53e46f0e47850fe /test cases
parente04bce3f0453fc73c2170cfbf2f51debe2fc33c3 (diff)
downloadmeson-942aea230f5e517d5add194240c8943f28d79943.zip
meson-942aea230f5e517d5add194240c8943f28d79943.tar.gz
meson-942aea230f5e517d5add194240c8943f28d79943.tar.bz2
Add MASM compiler
ml and armasm are Microsoft's Macro Assembler, part of MSVC.
Diffstat (limited to 'test cases')
-rw-r--r--test cases/windows/21 masm/hello.masm33
-rw-r--r--test cases/windows/21 masm/meson.build14
2 files changed, 47 insertions, 0 deletions
diff --git a/test cases/windows/21 masm/hello.masm b/test cases/windows/21 masm/hello.masm
new file mode 100644
index 0000000..a47dc96
--- /dev/null
+++ b/test cases/windows/21 masm/hello.masm
@@ -0,0 +1,33 @@
+; ---------------------------------------------
+; Hello World for Win64 Intel x64 Assembly
+;
+; by fruel (https://github.com/fruel)
+; 13 June 2016
+; ---------------------------------------------
+
+GetStdHandle PROTO
+ExitProcess PROTO
+WriteConsoleA PROTO
+
+.data
+msg BYTE "Hello World!",0
+bytesWritten DWORD ?
+
+.code
+mainCRTStartup proc
+ sub rsp, 5 * 8 ; reserve shadow space
+
+ mov rcx, -11 ; nStdHandle (STD_OUTPUT_HANDLE)
+ call GetStdHandle
+
+ mov rcx, rax ; hConsoleOutput
+ lea rdx, msg ; *lpBuffer
+ mov r8, LENGTHOF msg - 1 ; nNumberOfCharsToWrite
+ lea r9, bytesWritten ; lpNumberOfCharsWritten
+ mov QWORD PTR [rsp + 4 * SIZEOF QWORD], 0 ; lpReserved
+ call WriteConsoleA
+
+ mov rcx, 0 ; uExitCode
+ call ExitProcess
+mainCRTStartup endp
+END
diff --git a/test cases/windows/21 masm/meson.build b/test cases/windows/21 masm/meson.build
new file mode 100644
index 0000000..b6b8fbb
--- /dev/null
+++ b/test cases/windows/21 masm/meson.build
@@ -0,0 +1,14 @@
+project('test-masm', 'c')
+
+if get_option('backend').startswith('vs')
+ error('MESON_SKIP_TEST: masm is not supported by vs backend')
+endif
+
+cc = meson.get_compiler('c')
+
+# MASM must be found when using MSVC, otherwise it is optional
+if not add_languages('masm', required: cc.get_argument_syntax() == 'msvc')
+ error('MESON_SKIP_TEST: masm not available')
+endif
+
+executable('app', 'hello.masm')