17ec681f3Smrg# Copyright © 2020 Valve Corporation
27ec681f3Smrg
37ec681f3Smrg# Permission is hereby granted, free of charge, to any person obtaining a copy
47ec681f3Smrg# of this software and associated documentation files (the "Software"), to deal
57ec681f3Smrg# in the Software without restriction, including without limitation the rights
67ec681f3Smrg# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
77ec681f3Smrg# copies of the Software, and to permit persons to whom the Software is
87ec681f3Smrg# furnished to do so, subject to the following conditions:
97ec681f3Smrg
107ec681f3Smrg# The above copyright notice and this permission notice shall be included in
117ec681f3Smrg# all copies or substantial portions of the Software.
127ec681f3Smrg
137ec681f3Smrg# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
147ec681f3Smrg# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
157ec681f3Smrg# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
167ec681f3Smrg# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
177ec681f3Smrg# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
187ec681f3Smrg# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
197ec681f3Smrg# SOFTWARE.
207ec681f3Smrgaco_tests_files = files(
217ec681f3Smrg  'framework.h',
227ec681f3Smrg  'helpers.cpp',
237ec681f3Smrg  'helpers.h',
247ec681f3Smrg  'main.cpp',
257ec681f3Smrg  'test_assembler.cpp',
267ec681f3Smrg  'test_builder.cpp',
277ec681f3Smrg  'test_hard_clause.cpp',
287ec681f3Smrg  'test_insert_nops.cpp',
297ec681f3Smrg  'test_isel.cpp',
307ec681f3Smrg  'test_optimizer.cpp',
317ec681f3Smrg  'test_regalloc.cpp',
327ec681f3Smrg  'test_optimizer_postRA.cpp',
337ec681f3Smrg  'test_sdwa.cpp',
347ec681f3Smrg  'test_to_hw_instr.cpp',
357ec681f3Smrg  'test_tests.cpp',
367ec681f3Smrg)
377ec681f3Smrg
387ec681f3Smrgspirv_files = files(
397ec681f3Smrg  'test_isel.cpp',
407ec681f3Smrg)
417ec681f3Smrg
427ec681f3Smrggen_spirv = generator(prog_python,
437ec681f3Smrg                      output    : '@BASENAME@-spirv.h',
447ec681f3Smrg                      arguments : [join_paths(meson.current_source_dir(), 'glsl_scraper.py'),
457ec681f3Smrg                                   '@INPUT@', '--with-glslang', prog_glslang.path(), '-o', '@OUTPUT@'])
467ec681f3Smrggen_spirv_files = gen_spirv.process(spirv_files)
477ec681f3Smrg
487ec681f3Smrgtest(
497ec681f3Smrg  'aco_tests',
507ec681f3Smrg  executable(
517ec681f3Smrg    'aco_tests',
527ec681f3Smrg    [aco_tests_files, gen_spirv_files],
537ec681f3Smrg    cpp_args : ['-DACO_TEST_SOURCE_DIR="@0@"'.format(meson.current_source_dir()),
547ec681f3Smrg                '-DACO_TEST_BUILD_ROOT="@0@"'.format(meson.build_root()),
557ec681f3Smrg                '-DACO_TEST_PYTHON_BIN="@0@"'.format(prog_python.path())] +
567ec681f3Smrg               cpp_args_aco,
577ec681f3Smrg    include_directories : [
587ec681f3Smrg      inc_include, inc_src, inc_compiler, inc_mesa, inc_mapi, inc_amd, inc_amd_common, inc_amd_common_llvm,
597ec681f3Smrg    ],
607ec681f3Smrg    link_with : [
617ec681f3Smrg      libamd_common, libamd_common_llvm, libvulkan_radeon,
627ec681f3Smrg    ],
637ec681f3Smrg    dependencies : [
647ec681f3Smrg      dep_llvm, dep_thread, idep_aco, idep_nir, idep_mesautil, idep_vulkan_util_headers, idep_amdgfxregs_h,
657ec681f3Smrg    ],
667ec681f3Smrg    gnu_symbol_visibility : 'hidden',
677ec681f3Smrg    build_by_default : true,
687ec681f3Smrg  ),
697ec681f3Smrg  suite : ['amd', 'compiler'],
707ec681f3Smrg)
71