nir/tests: Refactor creation of loops for loop_analyze test cases

Inspired heavily by the work by Yevhenii Kolesnikov in the original
versions of !3445.

v2: Pass parameters to loop_builder using a struct. Add a comment
describing the loop being constructed to loop_builder. Both suggested by
Caio.

v3: mscv C++ designated initializer lolz.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21289>
This commit is contained in:
Ian Romanick
2023-01-31 17:50:11 -08:00
committed by Marge Bot
parent 7384ea7978
commit ffe0db099c
2 changed files with 133 additions and 261 deletions

View File

@@ -392,6 +392,12 @@ idep_nir = declare_dependency(
)
if with_tests
if cc.get_id() == 'msvc' and cc.version().version_compare('< 19.29')
msvc_designated_initializer = 'cpp_std=c++latest'
else
msvc_designated_initializer = 'cpp_std=c++20'
endif
test(
'nir_tests',
executable(
@@ -413,6 +419,7 @@ if with_tests
'tests/vars_tests.cpp',
),
cpp_args : [cpp_msvc_compat_args],
override_options: [msvc_designated_initializer],
gnu_symbol_visibility : 'hidden',
include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux],
dependencies : [dep_thread, idep_gtest, idep_nir, idep_mesautil],