Signed-off-by: Zhao Yi zhaoyi@uniontech.com --- dlls/ntdll/tests/large_int.c | 57 ++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+)
diff --git a/dlls/ntdll/tests/large_int.c b/dlls/ntdll/tests/large_int.c index 9635cac24ad..793696f1e4d 100644 --- a/dlls/ntdll/tests/large_int.c +++ b/dlls/ntdll/tests/large_int.c @@ -40,6 +40,9 @@ static LONGLONG (WINAPI *p_allmul)( LONGLONG a, LONGLONG b ); static ULONGLONG (WINAPI *p_aulldiv)( ULONGLONG a, ULONGLONG b ); static ULONGLONG (WINAPI *p_aullrem)( ULONGLONG a, ULONGLONG b );
+static LONGLONG (CDECL *p_allshl)(void); +static LONGLONG (CDECL *p_allshr)(void); + static void InitFunctionPtrs(void) { hntdll = LoadLibraryA("ntdll.dll"); @@ -56,6 +59,8 @@ static void InitFunctionPtrs(void) p_allmul = (void *)GetProcAddress(hntdll, "_allmul"); p_aulldiv = (void *)GetProcAddress(hntdll, "_aulldiv"); p_aullrem = (void *)GetProcAddress(hntdll, "_aullrem"); + p_allshl = (void *)GetProcAddress(hntdll, "_allshl"); + p_allshr = (void *)GetProcAddress(hntdll, "_allshr"); } /* if */ }
@@ -492,6 +497,56 @@ static void test_builtins(void) #endif /* __i386__ */ }
+static void test_allshl(void) +{ + int c = 0; + + asm("mov $0x55667788,%eax"); + asm("mov $0x11223344,%edx"); + asm("mov $0x4,%cl"); + c = p_allshl(); + ok(c == 0x56677880, "1. _allshl returned 0x%x\n", c); + + asm("mov $0x55667788,%eax"); + asm("mov $0x11223344,%edx"); + asm("mov $0x28,%cl"); + c = p_allshl(); + ok(c == 0, "2. _allshl returned 0x%x\n", c); + + asm("mov $0x55667788,%eax"); + asm("mov $0x11223344,%edx"); + asm("mov $0x46,%cl"); + c = p_allshl(); + ok(c == 0, "3. _allshl returned 0x%x\n", c); + + return; +} + +static void test_allshr(void) +{ + int c = 0; + + asm("mov $0x55667788,%eax"); + asm("mov $0x11223344,%edx"); + asm("mov $0x4,%cl"); + c = p_allshr(); + ok(c == 0x45566778, "1. _allshr returned 0x%x\n", c); + + asm("mov $0x55667788,%eax"); + asm("mov $0x11223344,%edx"); + asm("mov $0x28,%cl"); + c = p_allshr(); + ok(c == 0x112233, "2. _allshr returned 0x%x\n", c); + + asm("mov $0x55667788,%eax"); + asm("mov $0x11223344,%edx"); + asm("mov $0x46,%cl"); + c = p_allshr(); + ok(c == 0, "3. _allshr returned 0x%x\n", c); + + return; +} + START_TEST(large_int) { InitFunctionPtrs(); @@ -503,4 +558,6 @@ START_TEST(large_int) if (pRtlLargeIntegerToChar) test_RtlLargeIntegerToChar(); test_builtins(); + test_allshl(); + test_allshr(); }
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=116914
Your paranoid android.
=== w864 (64 bit report) ===
ntdll: 0bc0:large_int: unhandled exception c0000005 at 0000000000000000
=== w1064v1507 (64 bit report) ===
ntdll: 0d94:large_int: unhandled exception c0000005 at 0000000000000000
=== w1064v1809 (64 bit report) ===
ntdll: 1df4:large_int: unhandled exception c0000005 at 0000000000000000
=== w1064 (64 bit report) ===
ntdll: 1df4:large_int: unhandled exception c0000005 at 0000000000000000
=== w1064_2qxl (64 bit report) ===
ntdll: 1e84:large_int: unhandled exception c0000005 at 0000000000000000
=== w1064_adm (64 bit report) ===
ntdll: 1bd8:large_int: unhandled exception c0000005 at 0000000000000000
=== w1064_tsign (64 bit report) ===
ntdll: 0ee8:large_int: unhandled exception c0000005 at 0000000000000000
=== w10pro64 (64 bit report) ===
ntdll: 1d6c:large_int: unhandled exception c0000005 at 0000000000000000
=== w10pro64_en_AE_u8 (64 bit report) ===
ntdll: 1d90:large_int: unhandled exception c0000005 at 0000000000000000
=== w10pro64_ar (64 bit report) ===
ntdll: 0d88:large_int: unhandled exception c0000005 at 0000000000000000
=== w10pro64_ja (64 bit report) ===
ntdll: 1430:large_int: unhandled exception c0000005 at 0000000000000000
=== w10pro64_zh_CN (64 bit report) ===
ntdll: 2074:large_int: unhandled exception c0000005 at 0000000000000000
=== debian11 (64 bit WoW report) ===
ntdll: Unhandled exception: page fault on execute access to 0x0000000000000000 in 64-bit code (0000000000000000).