That is assumed in the asm implementation.
Signed-off-by: Paul Gofman pgofman@codeweavers.com --- v2: - use a helper function for valist conversion.
v3: - fix compilation on ARM.
dlls/vcomp/main.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/dlls/vcomp/main.c b/dlls/vcomp/main.c index 7b97dfc72c8..11dfb78030b 100644 --- a/dlls/vcomp/main.c +++ b/dlls/vcomp/main.c @@ -117,9 +117,14 @@ struct vcomp_task_data unsigned int dynamic_chunksize; };
+static void **ptr_from_va_list(__ms_va_list valist) +{ + return *(void ***)&valist; +} + #if defined(__i386__)
-extern void CDECL _vcomp_fork_call_wrapper(void *wrapper, int nargs, __ms_va_list args); +extern void CDECL _vcomp_fork_call_wrapper(void *wrapper, int nargs, void **args); __ASM_GLOBAL_FUNC( _vcomp_fork_call_wrapper, "pushl %ebp\n\t" __ASM_CFI(".cfi_adjust_cfa_offset 4\n\t") @@ -154,7 +159,7 @@ __ASM_GLOBAL_FUNC( _vcomp_fork_call_wrapper,
#elif defined(__x86_64__)
-extern void CDECL _vcomp_fork_call_wrapper(void *wrapper, int nargs, __ms_va_list args); +extern void CDECL _vcomp_fork_call_wrapper(void *wrapper, int nargs, void **args); __ASM_GLOBAL_FUNC( _vcomp_fork_call_wrapper, "pushq %rbp\n\t" __ASM_SEH(".seh_pushreg %rbp\n\t") @@ -198,7 +203,7 @@ __ASM_GLOBAL_FUNC( _vcomp_fork_call_wrapper,
#elif defined(__arm__)
-extern void CDECL _vcomp_fork_call_wrapper(void *wrapper, int nargs, __ms_va_list args); +extern void CDECL _vcomp_fork_call_wrapper(void *wrapper, int nargs, void **args); __ASM_GLOBAL_FUNC( _vcomp_fork_call_wrapper, "push {r4, r5, LR}\n\t" "mov r4, r0\n\t" @@ -234,7 +239,7 @@ __ASM_GLOBAL_FUNC( _vcomp_fork_call_wrapper,
#elif defined(__aarch64__)
-extern void CDECL _vcomp_fork_call_wrapper(void *wrapper, int nargs, __ms_va_list args); +extern void CDECL _vcomp_fork_call_wrapper(void *wrapper, int nargs, void **args); __ASM_GLOBAL_FUNC( _vcomp_fork_call_wrapper, "stp x29, x30, [SP,#-16]!\n\t" "mov x29, SP\n\t" @@ -263,7 +268,7 @@ __ASM_GLOBAL_FUNC( _vcomp_fork_call_wrapper,
#else
-static void CDECL _vcomp_fork_call_wrapper(void *wrapper, int nargs, __ms_va_list args) +static void CDECL _vcomp_fork_call_wrapper(void *wrapper, int nargs, void **args) { ERR("Not implemented for this architecture\n"); } @@ -1406,7 +1411,7 @@ static DWORD WINAPI _vcomp_fork_worker(void *param) if (team != NULL) { LeaveCriticalSection(&vcomp_section); - _vcomp_fork_call_wrapper(team->wrapper, team->nargs, team->valist); + _vcomp_fork_call_wrapper(team->wrapper, team->nargs, ptr_from_va_list(team->valist)); EnterCriticalSection(&vcomp_section);
thread_data->team = NULL; @@ -1540,7 +1545,7 @@ void WINAPIV _vcomp_fork(BOOL ifval, int nargs, void *wrapper, ...) }
vcomp_set_thread_data(&thread_data); - _vcomp_fork_call_wrapper(team_data.wrapper, team_data.nargs, team_data.valist); + _vcomp_fork_call_wrapper(team_data.wrapper, team_data.nargs, ptr_from_va_list(team_data.valist)); vcomp_set_thread_data(prev_thread_data); prev_thread_data->fork_threads = 0;
Used by Ancient Cities.
Signed-off-by: Paul Gofman pgofman@codeweavers.com --- v2: - use a helper function to copy the arguments through va_arg(); - fix argument copy count; - add missing __ms_va_end(); - add an overflow safe check for empty range (the corresponding test is added to the next patch). v3: - no changes.
dlls/vcomp/main.c | 158 ++++++++++++++++++++++++++++++++++++ dlls/vcomp110/vcomp110.spec | 2 +- dlls/vcomp120/vcomp120.spec | 2 +- dlls/vcomp140/vcomp140.spec | 2 +- 4 files changed, 161 insertions(+), 3 deletions(-)
diff --git a/dlls/vcomp/main.c b/dlls/vcomp/main.c index 11dfb78030b..fa0b84300f1 100644 --- a/dlls/vcomp/main.c +++ b/dlls/vcomp/main.c @@ -33,6 +33,8 @@
WINE_DEFAULT_DEBUG_CHANNEL(vcomp);
+#define MAX_VECT_PARALLEL_CALLBACK_ARGS 128 + typedef CRITICAL_SECTION *omp_lock_t; typedef CRITICAL_SECTION *omp_nest_lock_t;
@@ -122,6 +124,14 @@ static void **ptr_from_va_list(__ms_va_list valist) return *(void ***)&valist; }
+static void copy_va_list_data(void **args, __ms_va_list valist, int args_count) +{ + unsigned int i; + + for (i = 0; i < args_count; ++i) + args[i] = va_arg(valist, void *); +} + #if defined(__i386__)
extern void CDECL _vcomp_fork_call_wrapper(void *wrapper, int nargs, void **args); @@ -1665,6 +1675,154 @@ void CDECL _vcomp_leave_critsect(CRITICAL_SECTION *critsect) LeaveCriticalSection(critsect); }
+static unsigned int get_step_count(int start, int end, int range_offset, int step) +{ + int range = end - start + step - range_offset; + + if (step < 0) + return (unsigned)-range / -step; + else + return (unsigned)range / step; +} + +static void CDECL c2vectparallel_wrapper(int start, int end, int step, int end_included, BOOL dynamic_distribution, + int volatile *dynamic_start, void *function, int nargs, __ms_va_list valist) +{ + void *wrapper_args[MAX_VECT_PARALLEL_CALLBACK_ARGS]; + unsigned int step_count, steps_per_call, remainder; + int thread_count = omp_get_num_threads(); + int curr_start, curr_end, range_offset; + int thread = _vcomp_get_thread_num(); + int step_sign; + + copy_va_list_data(&wrapper_args[2], valist, nargs - 2); + + step_sign = step > 0 ? 1 : -1; + range_offset = step_sign * !end_included; + + if (dynamic_distribution) + { + int next_start, new_start, end_value; + + start = *dynamic_start; + end_value = end + !!end_included * step; + while (start != end_value) + { + step_count = get_step_count(start, end, range_offset, step); + + curr_end = start + (step_count + thread_count - 1) / thread_count * step + + range_offset; + + if ((curr_end - end) * step_sign > 0) + { + next_start = end_value; + curr_end = end; + } + else + { + next_start = curr_end - range_offset; + curr_end -= step; + } + + if ((new_start = InterlockedCompareExchange(dynamic_start, next_start, start)) != start) + { + start = new_start; + continue; + } + + wrapper_args[0] = (void *)(ULONG_PTR)start; + wrapper_args[1] = (void *)(ULONG_PTR)curr_end; + _vcomp_fork_call_wrapper(function, nargs, wrapper_args); + start = *dynamic_start; + } + return; + } + + step_count = get_step_count(start, end, range_offset, step); + + /* According to the tests native vcomp still makes extra calls + * with empty range from excessive threads under certain conditions + * for unclear reason. */ + if (thread >= step_count && (end_included || (step != 1 && step != -1))) + return; + + steps_per_call = step_count / thread_count; + remainder = step_count % thread_count; + + if (thread < remainder) + { + curr_start = thread * (steps_per_call + 1); + curr_end = curr_start + steps_per_call + 1; + } + else if (thread < step_count) + { + curr_start = remainder + steps_per_call * thread; + curr_end = curr_start + steps_per_call; + } + else + { + curr_start = curr_end = 0; + } + + curr_start = start + curr_start * step; + curr_end = start + (curr_end - 1) * step + range_offset; + + wrapper_args[0] = (void *)(ULONG_PTR)curr_start; + wrapper_args[1] = (void *)(ULONG_PTR)curr_end; + _vcomp_fork_call_wrapper(function, nargs, wrapper_args); +} + +void CDECL C2VectParallel(int start, int end, int step, BOOL end_included, int thread_count, + BOOL dynamic_distribution, void *function, int nargs, ...) +{ + struct vcomp_thread_data *thread_data; + int volatile dynamic_start; + int prev_thread_count; + __ms_va_list valist; + + TRACE("start %d, end %d, step %d, end_included %d, thread_count %d, dynamic_distribution %#x," + " function %p, nargs %d.\n", start, end, step, end_included, thread_count, + dynamic_distribution, function, nargs); + + if (nargs > MAX_VECT_PARALLEL_CALLBACK_ARGS) + { + FIXME("Number of arguments %u exceeds supported maximum %u" + " (not calling the loop code, expect problems).\n", + nargs, MAX_VECT_PARALLEL_CALLBACK_ARGS); + return; + } + + __ms_va_start(valist, nargs); + + /* This expression can result in integer overflow. According to the tests, + * native vcomp runs the function as a single thread both for empty range + * and (end - start) not fitting the integer range. */ + if ((step > 0 && end < start) || (step < 0 && end > start) + || (end - start) / step < 2 || thread_count < 0) + { + void *wrapper_args[MAX_VECT_PARALLEL_CALLBACK_ARGS]; + + wrapper_args[0] = (void *)(ULONG_PTR)start; + wrapper_args[1] = (void *)(ULONG_PTR)end; + copy_va_list_data(&wrapper_args[2], valist, nargs - 2); + _vcomp_fork_call_wrapper(function, nargs, wrapper_args); + __ms_va_end(valist); + return; + } + + thread_data = vcomp_init_thread_data(); + prev_thread_count = thread_data->fork_threads; + thread_data->fork_threads = thread_count; + + dynamic_start = start; + + _vcomp_fork(TRUE, 9, c2vectparallel_wrapper, start, end, step, end_included, dynamic_distribution, + &dynamic_start, function, nargs, valist); + + thread_data->fork_threads = prev_thread_count; + __ms_va_end(valist); +} + BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved) { TRACE("(%p, %d, %p)\n", instance, reason, reserved); diff --git a/dlls/vcomp110/vcomp110.spec b/dlls/vcomp110/vcomp110.spec index 22a94823c5f..fb4d626c07c 100644 --- a/dlls/vcomp110/vcomp110.spec +++ b/dlls/vcomp110/vcomp110.spec @@ -1,4 +1,4 @@ -@ stub C2VectParallel +@ varargs C2VectParallel(long long long long long long ptr long) @ cdecl _vcomp_atomic_add_i1(ptr long) @ cdecl _vcomp_atomic_add_i2(ptr long) @ cdecl _vcomp_atomic_add_i4(ptr long) diff --git a/dlls/vcomp120/vcomp120.spec b/dlls/vcomp120/vcomp120.spec index 22a94823c5f..fb4d626c07c 100644 --- a/dlls/vcomp120/vcomp120.spec +++ b/dlls/vcomp120/vcomp120.spec @@ -1,4 +1,4 @@ -@ stub C2VectParallel +@ varargs C2VectParallel(long long long long long long ptr long) @ cdecl _vcomp_atomic_add_i1(ptr long) @ cdecl _vcomp_atomic_add_i2(ptr long) @ cdecl _vcomp_atomic_add_i4(ptr long) diff --git a/dlls/vcomp140/vcomp140.spec b/dlls/vcomp140/vcomp140.spec index 22a94823c5f..fb4d626c07c 100644 --- a/dlls/vcomp140/vcomp140.spec +++ b/dlls/vcomp140/vcomp140.spec @@ -1,4 +1,4 @@ -@ stub C2VectParallel +@ varargs C2VectParallel(long long long long long long ptr long) @ cdecl _vcomp_atomic_add_i1(ptr long) @ cdecl _vcomp_atomic_add_i2(ptr long) @ cdecl _vcomp_atomic_add_i4(ptr long)
Signed-off-by: Paul Gofman pgofman@codeweavers.com --- v2: - added a (disabled) test for arguments count less than 2. v3: - no changes.
configure.ac | 1 + dlls/vcomp110/tests/Makefile.in | 4 + dlls/vcomp110/tests/vcomp110.c | 292 ++++++++++++++++++++++++++++++++ 3 files changed, 297 insertions(+) create mode 100644 dlls/vcomp110/tests/Makefile.in create mode 100644 dlls/vcomp110/tests/vcomp110.c
diff --git a/configure.ac b/configure.ac index 9bccde0c786..d814b6f85d7 100644 --- a/configure.ac +++ b/configure.ac @@ -3742,6 +3742,7 @@ WINE_CONFIG_MAKEFILE(dlls/vcomp) WINE_CONFIG_MAKEFILE(dlls/vcomp/tests) WINE_CONFIG_MAKEFILE(dlls/vcomp100) WINE_CONFIG_MAKEFILE(dlls/vcomp110) +WINE_CONFIG_MAKEFILE(dlls/vcomp110/tests) WINE_CONFIG_MAKEFILE(dlls/vcomp120) WINE_CONFIG_MAKEFILE(dlls/vcomp140) WINE_CONFIG_MAKEFILE(dlls/vcomp90) diff --git a/dlls/vcomp110/tests/Makefile.in b/dlls/vcomp110/tests/Makefile.in new file mode 100644 index 00000000000..98fba09e5b4 --- /dev/null +++ b/dlls/vcomp110/tests/Makefile.in @@ -0,0 +1,4 @@ +TESTDLL = vcomp110.dll + +C_SRCS = \ + vcomp110.c diff --git a/dlls/vcomp110/tests/vcomp110.c b/dlls/vcomp110/tests/vcomp110.c new file mode 100644 index 00000000000..65e3c36aa01 --- /dev/null +++ b/dlls/vcomp110/tests/vcomp110.c @@ -0,0 +1,292 @@ +/* + * Unit test suite for vcomp110 + * + * Copyright 2021 Paul Gofman for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include <stdio.h> +#include "wine/test.h" + +static HMODULE vcomp_handle; + +static void (CDECL *pC2VectParallel)(int start, int end, int step, BOOL end_included, int thread_count, + BOOL dynamic_distribution, void *function, int nargs, ...); +static int (CDECL *p_vcomp_get_thread_num)(void); +static int (CDECL *pomp_get_num_threads)(void); +static void (CDECL *pomp_set_num_threads)(int num_threads); +static void (CDECL *p_vcomp_set_num_threads)(int num_threads); + +#define VCOMP_GET_PROC(func) \ + do \ + { \ + p ## func = (void *)GetProcAddress(vcomp_handle, #func); \ + if (!p ## func) trace("Failed to get address for %s\n", #func); \ + } \ + while (0) + +static BOOL init_vcomp(void) +{ + vcomp_handle = LoadLibraryA("vcomp110.dll"); + if (!vcomp_handle) + { + win_skip("vcomp110.dll is not installed.\n"); + return FALSE; + } + + VCOMP_GET_PROC(C2VectParallel); + VCOMP_GET_PROC(_vcomp_get_thread_num); + VCOMP_GET_PROC(omp_get_num_threads); + VCOMP_GET_PROC(omp_set_num_threads); + VCOMP_GET_PROC(_vcomp_set_num_threads); + + return TRUE; +} + +#define TEST_C2VECTPARALLEL_MAX_THREADS 256 +#define TEST_C2VECTPARALLEL_MAX_VALUES 256 +#define TEST_C2VECTPARALLEL_MAX_CALLS 256 + +struct C2VectParallel_test_data +{ + int start; + int end; + int step; + BOOL end_included; + int thread_count; + unsigned int expected_call_count; + unsigned int expected_dynamic_call_count; +}; + +static volatile LONG test_C2VectParallel_call_count; + +static void CDECL test_C2VectParallel_payload(int start, int end, void *test_parameter, + const struct C2VectParallel_test_data *test, unsigned int test_index, BOOL dynamic_distribution) +{ + int thread_count = test->thread_count ? test->thread_count : 5; + int thread = p_vcomp_get_thread_num(); + int expected_start, expected_end; + int omp_num_threads; + int step_sign; + + step_sign = test->step > 0 ? 1 : -1; + + omp_num_threads = pomp_get_num_threads(); + + InterlockedIncrement(&test_C2VectParallel_call_count); + + if ((step_sign > 0 && test->end < test->start) || (step_sign < 0 && test->end > test->start) + || (test->end - test->start) / test->step < 2) + { + ok(omp_num_threads == 1, "Got unexpected omp_num_threads %u, thread_count %u, test %u.\n", + omp_num_threads, thread_count, test_index); + ok(!thread, "Got unexpected thread %d, test %u.\n", thread, test_index); + ok(start == test->start, "Got unexpected start %d, expected %d, thread %d, test %u.\n", + start, test->start, thread, test_index); + ok(end == test->end, "Got unexpected end %d, expected %d, thread %d, test %u.\n", + end, test->end, thread, test_index); + return; + } + + ok(thread_count == omp_num_threads, "Got unexpected omp_num_threads %u, thread_count %u, test %u.\n", + omp_num_threads, thread_count, test_index); + + ok(test_parameter == (void *)0xdeadbeef, "Got unexpected test_parameter %p.\n", test_parameter); + + if (dynamic_distribution) + { + unsigned int remaining_count; + unsigned int loop_count = 0; + + expected_start = test->start; + do + { + ++loop_count; + remaining_count = test->end - expected_start + test->step - step_sign * !test->end_included; + if (test->step < 0) + remaining_count = (unsigned int)-remaining_count / -test->step; + else + remaining_count /= test->step; + + expected_end = expected_start + (remaining_count + thread_count - 1) / thread_count * test->step + + step_sign * !test->end_included; + + if ((expected_end - test->end) * step_sign > 0) + expected_end = test->end; + else + expected_end -= test->step; + + if (expected_start == start) + break; + + expected_start = expected_end - step_sign * !test->end_included + test->step; + } + while (loop_count < 100); + ok(loop_count < 100, "Could not match start %d after %u iterations, test %u.\n", + start, loop_count, test_index); + } + else + { + unsigned int step_count, steps_per_call, remainder; + + step_count = test->end - test->start + test->step - step_sign * !test->end_included; + if (test->step < 0) + step_count = (unsigned int)-step_count / -test->step; + else + step_count /= test->step; + + steps_per_call = step_count / thread_count; + remainder = step_count % thread_count; + + if (thread < remainder) + { + expected_start = thread * (steps_per_call + 1); + expected_end = expected_start + steps_per_call + 1; + } + else if (thread < step_count) + { + expected_start = remainder + steps_per_call * thread; + expected_end = expected_start + steps_per_call; + } + else + { + expected_start = expected_end = 0; + } + + expected_start = test->start + expected_start * test->step; + expected_end = test->start + expected_end * test->step; + + expected_end -= test->step; + if (!test->end_included) + expected_end += step_sign; + } + + ok(start == expected_start, "Got unexpected start %d, expected %d, thread %d, test %u.\n", + start, expected_start, thread, test_index); + ok(end == expected_end, "Got unexpected end %d, expected %d, start %d, thread %d, dynamic %#x, test %u.\n", + end, expected_end, start, thread, dynamic_distribution, test_index); +} + +#if 0 +static void CDECL test_C2VectParallel_single_argument(int start) +{ + ok(0, "Should not get here.\n"); +} +#endif + +static void test_C2VectParallel(void) +{ + static const struct C2VectParallel_test_data tests[] = + { + {28, 28, 1, 0, 6, 1, 1}, + {28, 28, 1, 1, 6, 1, 1}, + {28, 29, 1, 0, 6, 1, 1}, + {28, 29, 1, 1, 6, 1, 1}, + + /* Native generates calls from excessive threads with empty range here. */ + {28, 30, 1, 0, 6, 6, 2}, + {28, 31, 1, 0, 6, 6, 3}, + {28, 33, 1, 0, 6, 6, 5}, + {0, -2, -1, 0, 3, 3, 2}, + + /* But not in such cases. */ + {28, 30, 1, 1, 6, 3, 3}, + {28, 31, 2, 0, 6, 1, 1}, + {28, 32, 2, 0, 6, 2, 2}, + + {28, 57, 1, 0, 6, 6, 13}, + {28, 57, 1, 1, 6, 6, 13}, + {28, 57, 4, 1, 6, 6, 7}, + {28, 36, 4, 0, 6, 2, 2}, + {28, 36, 4, 1, 6, 3, 3}, + {36, 28, 4, 0, 6, 1, 1}, + {36, 28, 4, 1, 6, 1, 1}, + {57, 28, -1, 0, 6, 6, 13}, + {57, 28, -1, 1, 6, 6, 13}, + {36, 28, -4, 0, 6, 2, 2}, + {36, 28, -4, 1, 6, 3, 3}, + {28, 57, 1, 0, 0, 5, 11}, + {-10, -2, 2, 1, 2, 2, 3}, + {0x7ffffffd, 0x7fffffff, 1, 1, 2, 2, 2}, + {-1, 0x7fffffff, 0x10000000, 1, 2, 1, 1}, + {0, 0x7fffffff, 1, 0, 2, 2, 31}, + {0, 0x7fffffff, 1, 1, 2, 2, 32}, + {-10000, 0x7fffffff, 1, 1, 2, 1, 1}, + {-10000, 0x7fffffff, -1, 1, 2, 1, 1}, + {-10000, 0x7fffffff, 2, 1, 2, 1, 1}, + {-10000, 0x7ffffff0, 2, 1, 2, 1, 1}, + {-10000, 0x7fffffff - 10000, 1, 0, 1, 1, 1}, + {-10000, 0x7fffffff - 10000, 1, 1, 1, 1, 1}, + {-10000, 0x7fffffff - 10000, 1, 0, 2, 2, 31}, + {-10000, 0x7fffffff - 10000, 1, 1, 2, 2, 32}, + {-10000, 0x7fffffff - 10000, 2, 0, 2, 2, 31}, + {-10000, 0x7fffffff - 10000, 2, 1, 2, 2, 31}, + {0x80000001, 0, 2, 0, 3, 3, 51}, + {0x80000001, 0, 2, 1, 3, 3, 51}, + {0x80000000, 0x7fffffff, 1, 0, 3, 1, 1}, + {0x80000000, 0x7fffffff, 1, 1, 3, 1, 1}, + {0x80000000, 0x7fffffff, 2, 0, 3, 1, 1}, + {0x80000000, 0x7fffffff, 2, 1, 3, 1, 1}, + {0x80000001, 1, 1, 0, 3, 1, 1}, + {0x80000001, 1, 1, 1, 3, 1, 1}, + {0x80000001, 0, 1, 0, 3, 3, 52}, + {0x80000001, 0, 1, 1, 3, 3, 52}, + {28, 28, 1, 0, -1, 1, 1}, +#if 0 + /* Results in division by zero on Windows. */ + {28, 57, 0, 0, 6, 6}, +#endif + }; + int num_threads; + unsigned int i; + + pomp_set_num_threads(5); + p_vcomp_set_num_threads(3); + num_threads = pomp_get_num_threads(); + ok(num_threads == 1, "Got unexpected num_threads %u.\n", num_threads); + +#if 0 + /* Results in stack overflow on Windows. */ + pC2VectParallel(28, 57, 1, 0, 2, FALSE, test_C2VectParallel_single_argument, 1); +#endif + + for (i = 0; i < ARRAY_SIZE(tests); ++i) + { + const struct C2VectParallel_test_data *test = &tests[i]; + + test_C2VectParallel_call_count = 0; + pC2VectParallel(test->start, test->end, test->step, test->end_included, test->thread_count, + FALSE, test_C2VectParallel_payload, 6, (void *)0xdeadbeef, test, i, FALSE); + ok(test_C2VectParallel_call_count == test->expected_call_count, + "Got unexpected call count %u, expected %u, test %u.\n", + test_C2VectParallel_call_count, test->expected_call_count, i); + + test_C2VectParallel_call_count = 0; + pC2VectParallel(test->start, test->end, test->step, test->end_included, test->thread_count, + ~0u, test_C2VectParallel_payload, 6, (void *)0xdeadbeef, test, i, TRUE); + ok(test_C2VectParallel_call_count == test->expected_dynamic_call_count, + "Got unexpected call count %u, expected %u, test %u.\n", + test_C2VectParallel_call_count, test->expected_dynamic_call_count, i); + } +} + +START_TEST(vcomp110) +{ + if (!init_vcomp()) + return; + + test_C2VectParallel(); +}