@@ -3538,13 +3538,11 @@ def prep_no_SAB(self):
3538
3538
3539
3539
# Test that the emscripten_ atomics api functions work.
3540
3540
@requires_threads
3541
- @no_wasm_backend ('TODO - fix final pthreads tests (#8718)' )
3542
3541
def test_pthread_atomics (self ):
3543
3542
self .btest (path_from_root ('tests' , 'pthread' , 'test_pthread_atomics.cpp' ), expected = '0' , args = ['-s' , 'TOTAL_MEMORY=64MB' , '-O3' , '-s' , 'USE_PTHREADS=1' , '-s' , 'PTHREAD_POOL_SIZE=8' ])
3544
3543
3545
3544
# Test 64-bit atomics.
3546
3545
@requires_threads
3547
- @flaky # TODO - fix final pthreads tests (#8718)
3548
3546
def test_pthread_64bit_atomics (self ):
3549
3547
self .btest (path_from_root ('tests' , 'pthread' , 'test_pthread_64bit_atomics.cpp' ), expected = '0' , args = ['-s' , 'TOTAL_MEMORY=64MB' , '-O3' , '-s' , 'USE_PTHREADS=1' , '-s' , 'PTHREAD_POOL_SIZE=8' ])
3550
3548
@@ -3557,17 +3555,17 @@ def test_pthread_64bit_cxx11_atomics(self):
3557
3555
3558
3556
# Test the old GCC atomic __sync_fetch_and_op builtin operations.
3559
3557
@requires_threads
3560
- @no_wasm_backend ('TODO - fix final pthreads tests (#8718)' )
3561
3558
def test_pthread_gcc_atomic_fetch_and_op (self ):
3562
3559
# We need to resort to using regexes to optimize out SharedArrayBuffer when pthreads are not supported, which is brittle!
3563
3560
# Therefore perform very extensive testing of different codegen modes to catch any problems.
3564
- for opt in [[], ['-O1' ], ['-O2' ], ['-O3' ], ['-O3' , '-s' , 'AGGRESSIVE_VARIABLE_ELIMINATION=1' ], ['-Os' ], [ '-Oz' ] ]:
3561
+ for opt in [[], ['-O1' ], ['-O2' ], ['-O3' ], ['-O3' , '-s' , 'AGGRESSIVE_VARIABLE_ELIMINATION=1' ], ['-Os' ]]:
3565
3562
for debug in [[], ['-g1' ], ['-g2' ], ['-g4' ]]:
3566
3563
for f32 in [[], ['-s' , 'PRECISE_F32=1' , '--separate-asm' , '-s' , 'WASM=0' ]]:
3567
- print (opt , debug , f32 )
3568
- if self .is_wasm_backend () and '--separate-asm' in f32 :
3564
+ args = opt + debug + f32
3565
+ print (args )
3566
+ if self .is_wasm_backend () and '--separate-asm' in args or 'AGGRESSIVE_VARIABLE_ELIMINATION=1' in args :
3569
3567
continue
3570
- self .btest (path_from_root ('tests' , 'pthread' , 'test_pthread_gcc_atomic_fetch_and_op.cpp' ), expected = '0' , args = opt + debug + f32 + ['-s' , 'TOTAL_MEMORY=64MB' , '-s' , 'USE_PTHREADS=1' , '-s' , 'PTHREAD_POOL_SIZE=8' ])
3568
+ self .btest (path_from_root ('tests' , 'pthread' , 'test_pthread_gcc_atomic_fetch_and_op.cpp' ), expected = '0' , args = args + ['-s' , 'TOTAL_MEMORY=64MB' , '-s' , 'USE_PTHREADS=1' , '-s' , 'PTHREAD_POOL_SIZE=8' ])
3571
3569
3572
3570
# 64 bit version of the above test.
3573
3571
@requires_threads
@@ -3590,15 +3588,13 @@ def test_pthread_gcc_atomics(self):
3590
3588
self .btest (path_from_root ('tests' , 'pthread' , 'test_pthread_gcc_atomics.cpp' ), expected = '0' , args = ['-s' , 'TOTAL_MEMORY=64MB' , '-O3' , '-s' , 'USE_PTHREADS=1' , '-s' , 'PTHREAD_POOL_SIZE=8' ])
3591
3589
3592
3590
# Test the __sync_lock_test_and_set and __sync_lock_release primitives.
3593
- @no_wasm_backend ('TODO - fix final pthreads tests (#8718)' )
3594
3591
@requires_threads
3595
3592
def test_pthread_gcc_spinlock (self ):
3596
3593
for arg in [[], ['-DUSE_EMSCRIPTEN_INTRINSICS' ]]:
3597
3594
self .btest (path_from_root ('tests' , 'pthread' , 'test_pthread_gcc_spinlock.cpp' ), expected = '800' , args = ['-s' , 'TOTAL_MEMORY=64MB' , '-O3' , '-s' , 'USE_PTHREADS=1' , '-s' , 'PTHREAD_POOL_SIZE=8' ] + arg , also_asmjs = True )
3598
3595
3599
3596
# Test that basic thread creation works.
3600
3597
@requires_threads
3601
- @no_wasm_backend ('TODO - fix final pthreads tests (#8718)' )
3602
3598
def test_pthread_create (self ):
3603
3599
def test (args ):
3604
3600
print (args )
@@ -3615,7 +3611,6 @@ def test_pthread_proxy_to_pthread(self):
3615
3611
3616
3612
# Test that a pthread can spawn another pthread of its own.
3617
3613
@requires_threads
3618
- @no_wasm_backend ('TODO - fix final pthreads tests (#8718)' )
3619
3614
def test_pthread_create_pthread (self ):
3620
3615
for modularize in [[], ['-s' , 'MODULARIZE=1' , '-s' , 'EXPORT_NAME=MyModule' , '--shell-file' , path_from_root ('tests' , 'shell_that_launches_modularize.html' )]]:
3621
3616
self .btest (path_from_root ('tests' , 'pthread' , 'test_pthread_create_pthread.cpp' ), expected = '1' , args = ['-O3' , '-s' , 'USE_PTHREADS=1' , '-s' , 'PTHREAD_POOL_SIZE=2' ] + modularize )
@@ -3632,7 +3627,6 @@ def test_pthread_join(self):
3632
3627
3633
3628
# Test that threads can rejoin the pool once detached and finished
3634
3629
@requires_threads
3635
- @no_wasm_backend ('TODO - fix final pthreads tests (#8718)' )
3636
3630
def test_std_thread_detach (self ):
3637
3631
self .btest (path_from_root ('tests' , 'pthread' , 'test_std_thread_detach.cpp' ), expected = '0' , args = ['-std=c++11' , '-s' , 'USE_PTHREADS=1' ])
3638
3632
@@ -3796,7 +3790,6 @@ def test_pthread_proxying_in_futex_wait(self):
3796
3790
self .btest (path_from_root ('tests' , 'pthread' , 'test_pthread_proxying_in_futex_wait.cpp' ), expected = '0' , args = ['-O3' , '-s' , 'USE_PTHREADS=1' , '-s' , 'PTHREAD_POOL_SIZE=1' ])
3797
3791
3798
3792
# Test that sbrk() operates properly in multithreaded conditions
3799
- @no_wasm_backend ('TODO - fix final pthreads tests (#8718)' )
3800
3793
@requires_threads
3801
3794
def test_pthread_sbrk (self ):
3802
3795
for aborting_malloc in [0 , 1 ]:
0 commit comments