"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "dlls/kernel32/tests/thread.c" between
wine-5.12.tar.xz and wine-5.13.tar.xz

About: Wine is an Open Source implementation of the MS Windows API on top of X, OpenGL, and Unix. Think of Wine as a compatibility layer for running Windows programs. Development release.

thread.c  (wine-5.12.tar.xz):thread.c  (wine-5.13.tar.xz)
skipping to change at line 25 skipping to change at line 25
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include <assert.h> #include <assert.h>
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>
#include <float.h> #include <float.h>
#include <math.h>
/* the tests intentionally pass invalid pointers and need an exception handler * / /* the tests intentionally pass invalid pointers and need an exception handler * /
#define WINE_NO_INLINE_STRING #define WINE_NO_INLINE_STRING
#include <ntstatus.h> #include <ntstatus.h>
#define WIN32_NO_STATUS #define WIN32_NO_STATUS
#include <windef.h> #include <windef.h>
#include <winbase.h> #include <winbase.h>
#include <winnt.h> #include <winnt.h>
#include <winerror.h> #include <winerror.h>
skipping to change at line 1832 skipping to change at line 1833
return MAKELONG( cw, sse ); return MAKELONG( cw, sse );
#elif defined(__aarch64__) #elif defined(__aarch64__)
unsigned long cw; unsigned long cw;
__asm__ __volatile__( "mrs %0, fpcr" : "=r" (cw) ); __asm__ __volatile__( "mrs %0, fpcr" : "=r" (cw) );
return cw; return cw;
#else #else
return 0; return 0;
#endif #endif
} }
static inline void fpu_invalid_operation(void)
{
double d;
#if defined(__i386__)
unsigned int sse;
#ifdef _MSC_VER
__asm { stmxcsr [sse] }
sse |= 1; /* invalid operation flag */
__asm { ldmxcsr [sse] }
#else
__asm__ volatile ("stmxcsr %0" : "=m" (sse));
sse |= 1;
__asm__ volatile ("ldmxcsr %0" : : "m" (sse));
#endif
#endif
d = acos(2.0);
ok(_isnan(d), "d = %lf\n", d);
ok(_statusfp() == _SW_INVALID, "_statusfp() = %x\n", _statusfp());
}
static DWORD WINAPI fpu_thread(void *param) static DWORD WINAPI fpu_thread(void *param)
{ {
struct fpu_thread_ctx *ctx = param; struct fpu_thread_ctx *ctx = param;
BOOL ret; BOOL ret;
ctx->cw = _control87( 0, 0 ); ctx->cw = _control87( 0, 0 );
ctx->fpu_cw = get_fpu_cw(); ctx->fpu_cw = get_fpu_cw();
ret = SetEvent(ctx->finished); ret = SetEvent(ctx->finished);
ok(ret, "SetEvent failed, last error %#x.\n", GetLastError()); ok(ret, "SetEvent failed, last error %#x.\n", GetLastError());
skipping to change at line 1873 skipping to change at line 1896
CloseHandle(thread); CloseHandle(thread);
*fpu_cw = ctx.fpu_cw; *fpu_cw = ctx.fpu_cw;
return ctx.cw; return ctx.cw;
} }
static void test_thread_fpu_cw(void) static void test_thread_fpu_cw(void)
{ {
static const struct { static const struct {
unsigned int cw; unsigned long fpu_cw; unsigned long fpu_cw_broken; unsigned int cw; unsigned long fpu_cw; unsigned long fpu_cw_broken;
} expected_cw[6] = } expected_cw[8] =
{ {
#ifdef __i386__ #ifdef __i386__
{ _MCW_EM | _PC_53, MAKELONG( 0x27f, 0x1f80 ) }, { _MCW_EM | _PC_53, MAKELONG( 0x27f, 0x1f80 ) },
{ _MCW_EM | _PC_53, MAKELONG( 0x27f, 0x1f80 ) }, { _MCW_EM | _PC_53, MAKELONG( 0x27f, 0x1f80 ) },
{ _EM_INEXACT | _RC_CHOP | _PC_24, MAKELONG( 0xc60, 0x7000 ), MAKELONG( 0xc60, 0x1f80 ) }, { _EM_INEXACT | _RC_CHOP | _PC_24, MAKELONG( 0xc60, 0x7000 ), MAKELONG( 0xc60, 0x1f80 ) },
{ _MCW_EM | _PC_53, MAKELONG( 0x27f, 0x1f80 ) }, { _MCW_EM | _PC_53, MAKELONG( 0x27f, 0x1f80 ) },
{ _EM_INEXACT | _RC_CHOP | _PC_24, MAKELONG( 0xc60, 0x7000 ), MAKELONG( 0xc60, 0x1f80 ) }, { _EM_INEXACT | _RC_CHOP | _PC_24, MAKELONG( 0xc60, 0x7000 ), MAKELONG( 0xc60, 0x1f80 ) },
{ _MCW_EM | _PC_53, MAKELONG( 0x27f, 0x1f80 ) } { _MCW_EM | _PC_53, MAKELONG( 0x27f, 0x1f80 ) },
{ _MCW_EM | _PC_53, MAKELONG( 0x27f, 0x1f81 ) },
{ _MCW_EM | _PC_53, MAKELONG( 0x27f, 0x1f81 ) }
#elif defined(__x86_64__) #elif defined(__x86_64__)
{ _MCW_EM | _PC_64, MAKELONG( 0x27f, 0x1f80 ) }, { _MCW_EM | _PC_64, MAKELONG( 0x27f, 0x1f80 ) },
{ _MCW_EM | _PC_64, MAKELONG( 0x27f, 0x1f80 ) }, { _MCW_EM | _PC_64, MAKELONG( 0x27f, 0x1f80 ) },
{ _EM_INEXACT | _RC_CHOP | _PC_64, MAKELONG( 0x27f, 0x7000 ) }, { _EM_INEXACT | _RC_CHOP | _PC_64, MAKELONG( 0x27f, 0x7000 ) },
{ _MCW_EM | _PC_64, MAKELONG( 0x27f, 0x1f80 ) }, { _MCW_EM | _PC_64, MAKELONG( 0x27f, 0x1f80 ) },
{ _EM_INEXACT | _RC_CHOP | _PC_64, MAKELONG( 0x27f, 0x7000 ) }, { _EM_INEXACT | _RC_CHOP | _PC_64, MAKELONG( 0x27f, 0x7000 ) },
{ _MCW_EM | _PC_64, MAKELONG( 0x27f, 0x1f80 ) } { _MCW_EM | _PC_64, MAKELONG( 0x27f, 0x1f80 ) },
{ _MCW_EM | _PC_64, MAKELONG( 0x27f, 0x1f81 ) },
{ _MCW_EM | _PC_64, MAKELONG( 0x27f, 0x1f81 ) }
#elif defined(__aarch64__) #elif defined(__aarch64__)
{ _MCW_EM | _PC_64, 0 }, { _MCW_EM | _PC_64, 0 },
{ _MCW_EM | _PC_64, 0 }, { _MCW_EM | _PC_64, 0 },
{ _EM_INEXACT | _RC_CHOP | _PC_64, 0xc08f00 }, { _EM_INEXACT | _RC_CHOP | _PC_64, 0xc08f00 },
{ _MCW_EM | _PC_64, 0 }, { _MCW_EM | _PC_64, 0 },
{ _EM_INEXACT | _RC_CHOP | _PC_64, 0xc08f00 }, { _EM_INEXACT | _RC_CHOP | _PC_64, 0xc08f00 },
{ _MCW_EM | _PC_64, 0 },
{ _MCW_EM | _PC_64, 0 },
{ _MCW_EM | _PC_64, 0 } { _MCW_EM | _PC_64, 0 }
#else #else
{ 0xdeadbeef, 0xdeadbeef } { 0xdeadbeef, 0xdeadbeef }
#endif #endif
}; };
unsigned int initial_cw, cw; unsigned int initial_cw, cw;
unsigned long fpu_cw; unsigned long fpu_cw;
fpu_cw = get_fpu_cw(); fpu_cw = get_fpu_cw();
initial_cw = _control87( 0, 0 ); initial_cw = _control87( 0, 0 );
skipping to change at line 1936 skipping to change at line 1965
ok(cw == expected_cw[4].cw, "expected %#x got %#x\n", expected_cw[4].cw, cw) ; ok(cw == expected_cw[4].cw, "expected %#x got %#x\n", expected_cw[4].cw, cw) ;
ok(fpu_cw == expected_cw[4].fpu_cw || ok(fpu_cw == expected_cw[4].fpu_cw ||
broken(expected_cw[4].fpu_cw_broken && fpu_cw == expected_cw[4].fpu_ cw_broken), broken(expected_cw[4].fpu_cw_broken && fpu_cw == expected_cw[4].fpu_ cw_broken),
"expected %#lx got %#lx\n", expected_cw[4].fpu_cw, fpu_cw); "expected %#lx got %#lx\n", expected_cw[4].fpu_cw, fpu_cw);
_control87( initial_cw, _MCW_EM | _MCW_RC | _MCW_PC ); _control87( initial_cw, _MCW_EM | _MCW_RC | _MCW_PC );
cw = _control87( 0, 0 ); cw = _control87( 0, 0 );
fpu_cw = get_fpu_cw(); fpu_cw = get_fpu_cw();
ok(cw == expected_cw[5].cw, "expected %#x got %#x\n", expected_cw[5].cw, cw) ; ok(cw == expected_cw[5].cw, "expected %#x got %#x\n", expected_cw[5].cw, cw) ;
ok(fpu_cw == expected_cw[5].fpu_cw, "expected %#lx got %#lx\n", expected_cw[ 5].fpu_cw, fpu_cw); ok(fpu_cw == expected_cw[5].fpu_cw, "expected %#lx got %#lx\n", expected_cw[ 5].fpu_cw, fpu_cw);
fpu_invalid_operation();
cw = _control87( 0, 0 );
fpu_cw = get_fpu_cw();
ok(cw == expected_cw[6].cw, "expected %#x got %#x\n", expected_cw[6].cw, cw)
;
ok(fpu_cw == expected_cw[6].fpu_cw, "expected %#lx got %#lx\n", expected_cw[
6].fpu_cw, fpu_cw);
cw = _control87( initial_cw, _MCW_EM | _MCW_RC | _MCW_PC );
fpu_cw = get_fpu_cw();
ok(cw == expected_cw[7].cw, "expected %#x got %#x\n", expected_cw[6].cw, cw)
;
ok(fpu_cw == expected_cw[7].fpu_cw, "expected %#lx got %#lx\n", expected_cw[
6].fpu_cw, fpu_cw);
_clearfp();
} }
static const char manifest_dep[] = static const char manifest_dep[] =
"<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">" "<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">"
"<assemblyIdentity version=\"1.2.3.4\" name=\"testdep1\" type=\"win32\" process orArchitecture=\"" ARCH "\"/>" "<assemblyIdentity version=\"1.2.3.4\" name=\"testdep1\" type=\"win32\" process orArchitecture=\"" ARCH "\"/>"
" <file name=\"testdep.dll\" />" " <file name=\"testdep.dll\" />"
"</assembly>"; "</assembly>";
static const char manifest_main[] = static const char manifest_main[] =
"<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">" "<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">"
 End of changes. 7 change blocks. 
3 lines changed or deleted 48 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)