File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change 108
108
]
109
109
110
110
DEFAULT_ASYNCIFY_EXPORTS = [
111
- 'main'
111
+ 'main' ,
112
+ '__main_argc_argv'
112
113
]
113
114
114
115
# Target options
Original file line number Diff line number Diff line change @@ -8036,6 +8036,21 @@ def test_setlocale(self):
8036
8036
def test_vswprintf_utf8 (self ):
8037
8037
self .do_run_in_out_file_test ('vswprintf_utf8.c' )
8038
8038
8039
+ # Test that a main with arguments is automatically asyncified.
8040
+ @no_wasm64 ('TODO: asyncify for wasm64' )
8041
+ @with_asyncify_and_stack_switching
8042
+ def test_async_main (self ):
8043
+ create_file ('main.c' , r'''
8044
+ #include <stdio.h>
8045
+ #include <emscripten.h>
8046
+ int main(int argc, char **argv) {
8047
+ emscripten_sleep(1);
8048
+ printf("argc=%d argv=%s\n", argc, argv[1]);
8049
+ }
8050
+ ''' )
8051
+
8052
+ self .do_runf ('main.c' , 'argc=2 argv=hello' , args = ['hello' ])
8053
+
8039
8054
@no_wasm64 ('TODO: asyncify for wasm64' )
8040
8055
@with_asyncify_and_stack_switching
8041
8056
def test_async_hello (self ):
You can’t perform that action at this time.
0 commit comments