diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-29 04:41:38 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-29 04:41:38 +0000 |
commit | 7b6e527f440cd7e6f8be2b07cee320ee6ca18786 (patch) | |
tree | 4a2738d69fa2814659fdadddf5826282e73d81f4 /test cases/nasm/2 asm language/meson.build | |
parent | Initial commit. (diff) | |
download | meson-7b6e527f440cd7e6f8be2b07cee320ee6ca18786.tar.xz meson-7b6e527f440cd7e6f8be2b07cee320ee6ca18786.zip |
Adding upstream version 1.0.1.upstream/1.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test cases/nasm/2 asm language/meson.build')
-rw-r--r-- | test cases/nasm/2 asm language/meson.build | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/test cases/nasm/2 asm language/meson.build b/test cases/nasm/2 asm language/meson.build new file mode 100644 index 0000000..390ffed --- /dev/null +++ b/test cases/nasm/2 asm language/meson.build @@ -0,0 +1,57 @@ +project('test', 'c') + +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 not add_languages('nasm', required: false) + nasm = find_program('nasm', 'yasm', required: false) + assert(not nasm.found()) + error('MESON_SKIP_TEST: nasm not found') +endif + +nasm = meson.get_compiler('nasm') + +code = ''' +SECTION .text +global main +main: + mov foo,bar ; error: symbol `foo' not defined +''' +assert(not nasm.compiles(code, name: 'Invalid NASM code')) + +code = ''' +SECTION .text +global main +main: + mov eax,1 +''' +assert(nasm.compiles(code, name: 'Valid NASM code')) + +config_file = configure_file( + output: 'config.asm', + configuration: {'HELLO': 0}, + output_format: 'nasm', +) + +cc = meson.get_compiler('c') +link_args = cc.get_supported_link_arguments(['-no-pie']) + +exe = executable('hello', 'hello.asm', + nasm_args: '-DFOO', + link_args: link_args, +) +test('hello', exe) + +#Test whether pthread dependency gets filtered out +threads = dependency('threads') + +exe2 = executable('hello_w_threads', 'hello.asm', + config_file, + nasm_args: '-DFOO', + link_args: link_args, + dependencies: [threads] +) + +test('hello_w_threads', exe2) |