From 53ec050e3606d26f847209bd2b4703cd0b23289a Mon Sep 17 00:00:00 2001 From: "L. E. Segovia" Date: Tue, 25 Apr 2023 21:39:40 +0000 Subject: [PATCH] nasm test: Add a test for validating the Xcode backend --- .../nasm/4 through configure/dummy.asm.in | 4 +++ test cases/nasm/4 through configure/dummy.def | 2 ++ .../nasm/4 through configure/meson.build | 30 +++++++++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 test cases/nasm/4 through configure/dummy.asm.in create mode 100644 test cases/nasm/4 through configure/dummy.def create mode 100644 test cases/nasm/4 through configure/meson.build diff --git a/test cases/nasm/4 through configure/dummy.asm.in b/test cases/nasm/4 through configure/dummy.asm.in new file mode 100644 index 000000000..5be150e44 --- /dev/null +++ b/test cases/nasm/4 through configure/dummy.asm.in @@ -0,0 +1,4 @@ +global dummy +section .rodata align=16 +dummy: + dd 0x00010203 diff --git a/test cases/nasm/4 through configure/dummy.def b/test cases/nasm/4 through configure/dummy.def new file mode 100644 index 000000000..8f8eb9959 --- /dev/null +++ b/test cases/nasm/4 through configure/dummy.def @@ -0,0 +1,2 @@ +EXPORTS + dummy diff --git a/test cases/nasm/4 through configure/meson.build b/test cases/nasm/4 through configure/meson.build new file mode 100644 index 000000000..373810f5f --- /dev/null +++ b/test cases/nasm/4 through configure/meson.build @@ -0,0 +1,30 @@ +project('through configure') + +if not add_languages('nasm', required: false) + error('MESON_SKIP_TEST: nasm not found') +endif + +if not host_machine.cpu_family().startswith('x86') + assert(not add_languages('nasm', required: false)) + error('MESON_SKIP_TEST: nasm only supported for x86 and x86_64') +endif + +if meson.backend().startswith('vs') + error('MESON_SKIP_TEST: VS backend does not recognise NASM yet') +endif + +section = host_machine.system() == 'macos' ? '.rodata' : '.rdata' + +sources = configure_file( + input: 'dummy.asm.in', + output: 'dummy.asm', + configuration: { + 'section': section + } +) + +dummy = library( + 'dummy', + sources, + vs_module_defs: 'dummy.def', +)