Skip to content

Commit b413cce

Browse files
committed
[wasm64] Fix a lot of the remaining browser tests
This also inverts the testing logic such that we run all browser tests in wasm64 mode. Tests that don't currently pass are annotated with @no_wasm64.
1 parent 9c15c4d commit b413cce

File tree

12 files changed

+205
-89
lines changed

12 files changed

+205
-89
lines changed

.circleci/config.yml

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -790,28 +790,7 @@ jobs:
790790
steps:
791791
- run-tests-chrome:
792792
title: "browser64"
793-
test_targets: "
794-
browser64.test_canvas_focus
795-
browser64.test_anisotropic
796-
browser64.test_webgpu_get_device
797-
browser64.test_fetch_*
798-
browser64.test_pthread_*
799-
browser64.test_wget_*
800-
browser64.test_emscripten_async_wget_*
801-
browser64.test_wasm_worker_*
802-
browser64.test_sdl_*
803-
browser64.test_sdl1_*
804-
browser64.test_egl*
805-
browser64.test_gl_*
806-
browser64.test_glgears*
807-
browser64.test_glfw*
808-
browser64.test_glew
809-
browser64.test_idbstore*
810-
browser64.test_fs_idbfs*
811-
browser64.test_webgl*
812-
browser64.test_glbook
813-
browser64.test_gles2_emulation*
814-
"
793+
test_targets: "browser64 skip:browser64.test_zzz_zzz_4gb_fail"
815794
test-browser-firefox:
816795
executor: bionic
817796
steps:

src/library_pthread.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ var LibraryPThread = {
143143

144144
#if PTHREADS_PROFILING
145145
getThreadName(pthreadPtr) {
146-
var profilerBlock = {{{ makeGetValue('pthreadPtr', C_STRUCTS.pthread.profilerBlock, POINTER_TYPE) }}};
146+
var profilerBlock = {{{ makeGetValue('pthreadPtr', C_STRUCTS.pthread.profilerBlock, '*') }}};
147147
if (!profilerBlock) return "";
148148
return UTF8ToString(profilerBlock + {{{ C_STRUCTS.thread_profiler_block.name }}});
149149
},
@@ -162,7 +162,7 @@ var LibraryPThread = {
162162
},
163163

164164
threadStatusAsString(pthreadPtr) {
165-
var profilerBlock = {{{ makeGetValue('pthreadPtr', C_STRUCTS.pthread.profilerBlock, POINTER_TYPE) }}};
165+
var profilerBlock = {{{ makeGetValue('pthreadPtr', C_STRUCTS.pthread.profilerBlock, '*') }}};
166166
var status = (profilerBlock == 0) ? 0 : Atomics.load(HEAPU32, {{{ getHeapOffset('profilerBlock + ' + C_STRUCTS.thread_profiler_block.threadStatus, 'i32') }}});
167167
return PThread.threadStatusToString(status);
168168
},
@@ -761,7 +761,7 @@ var LibraryPThread = {
761761
// Deduce which WebGL canvases (HTMLCanvasElements or OffscreenCanvases) should be passed over to the
762762
// Worker that hosts the spawned pthread.
763763
// Comma-delimited list of CSS selectors that must identify canvases by IDs: "#canvas1, #canvas2, ..."
764-
var transferredCanvasNames = attr ? {{{ makeGetValue('attr', C_STRUCTS.pthread_attr_t._a_transferredcanvases, POINTER_TYPE) }}} : 0;
764+
var transferredCanvasNames = attr ? {{{ makeGetValue('attr', C_STRUCTS.pthread_attr_t._a_transferredcanvases, '*') }}} : 0;
765765
#if OFFSCREENCANVASES_TO_PTHREAD
766766
// Proxied canvases string pointer -1 is used as a special token to fetch
767767
// whatever canvases were passed to build in -s

system/lib/compiler-rt/lib/sanitizer_common/sanitizer_emscripten.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@ u64 MonotonicNanoTime() {
127127
return (u64)ts.tv_sec * (1000ULL * 1000 * 1000) + ts.tv_nsec;
128128
}
129129

130+
// FIXME implement on this platform.
131+
void GetMemoryProfile(fill_profile_f cb, uptr *stats) {}
132+
130133
} // namespace __sanitizer
131134

132135
#endif
File renamed without changes.

test/browser/async_2.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ __attribute__((noinline)) int calc(int x) {
3434
}
3535
// Keep the recursion by passing the function pointer between C++ and JS, so
3636
// that we have a deeply nested stack.
37-
int (*fp)(int) = (int(*)(int))EM_ASM_INT({
37+
int (*fp)(int) = (int(*)(int))EM_ASM_PTR({
3838
return $0;
3939
}, &calc);
4040
return fp(x - 1);

test/fs_after_main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#define NAME "file.cpp"
1313

1414
EMSCRIPTEN_KEEPALIVE
15-
extern "C" void finish(void*) {
15+
extern "C" void finish() {
1616
EM_ASM({
1717
var printed = Module['extraSecretBuffer'].split('Iteration').length - 1;
1818
console.log(printed);

test/runtime_misuse.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ extern "C" {
1111
int noted = 0;
1212

1313
char* EMSCRIPTEN_KEEPALIVE note(int n) {
14-
EM_ASM({ Module.noted = $0 }, (long)&noted);
14+
EM_ASM({ Module.noted = Number($0); out("set noted " + Module.noted) }, (long)&noted);
1515
EM_ASM({ out([$0, $1]) }, n, noted);
1616
noted += n;
1717
EM_ASM({ out(['noted is now', $0]) }, noted);

test/runtime_misuse_2.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ extern "C" {
1111
int noted = 0;
1212

1313
char* EMSCRIPTEN_KEEPALIVE note(int n) {
14-
EM_ASM({ Module.noted = $0 }, (long)&noted);
14+
EM_ASM({ Module.noted = Number($0) }, (long)&noted);
1515
EM_ASM({ out([$0, $1]) }, n, noted);
1616
noted += n;
1717
EM_ASM({ out(['noted is now', $0]) }, noted);

0 commit comments

Comments
 (0)