-
Notifications
You must be signed in to change notification settings - Fork 800
PostEmscripten: Preserve __em_js__ exports (and data) in side modules #5780
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited. | ||
;; RUN: wasm-opt %s --post-emscripten --pass-arg=post-emscripten-side-module -S -o - | filecheck %s | ||
|
||
;; Checks that the __start_em_asm/__stop_em_asm are preserverd, along with | ||
;; all __em_js__ exports. | ||
|
||
(module | ||
;; CHECK: (global $em_asm_start i32 (i32.const 1000)) | ||
(global $em_asm_start i32 (i32.const 1000)) | ||
;; CHECK: (global $em_asm_stop i32 (i32.const 1011)) | ||
(global $em_asm_stop i32 (i32.const 1011)) | ||
;; CHECK: (global $em_js_start i32 (i32.const 2006)) | ||
(global $em_js_start i32 (i32.const 2006)) | ||
;; CHECK: (global $em_js_stop i32 (i32.const 2015)) | ||
(global $em_js_stop i32 (i32.const 2015)) | ||
;; CHECK: (global $__em_js__foo i32 (i32.const 2015)) | ||
(global $__em_js__foo i32 (i32.const 2015)) | ||
;; CHECK: (global $em_lib_deps_start i32 (i32.const 3000)) | ||
(global $em_lib_deps_start i32 (i32.const 3000)) | ||
;; CHECK: (global $em_lib_deps_stop i32 (i32.const 3009)) | ||
(global $em_lib_deps_stop i32 (i32.const 3009)) | ||
;; CHECK: (global $foo_start i32 (i32.const 4000)) | ||
(global $foo_start i32 (i32.const 4000)) | ||
;; CHECK: (global $foo_stop i32 (i32.const 4015)) | ||
(global $foo_stop i32 (i32.const 4015)) | ||
(memory 10 10) | ||
;; CHECK: (memory $0 10 10) | ||
|
||
;; CHECK: (data $data1 (i32.const 1000) "hello world") | ||
(data $data1 (i32.const 1000) "hello world") | ||
;; CHECK: (data $data2 (i32.const 2000) "hello DELETE ME world") | ||
(data $data2 (i32.const 2000) "hello DELETE ME world") | ||
;; CHECK: (data $data3 (i32.const 3000) "") | ||
(data $data3 (i32.const 3000) "some deps") | ||
;; CHECK: (export "__start_em_asm" (global $em_asm_start)) | ||
(export "__start_em_asm" (global $em_asm_start)) | ||
;; CHECK: (export "__stop_em_asm" (global $em_asm_stop)) | ||
(export "__stop_em_asm" (global $em_asm_stop)) | ||
(export "__start_em_js" (global $em_js_start)) | ||
(export "__stop_em_js" (global $em_js_stop)) | ||
;; CHECK: (export "__em_js__foo" (global $__em_js__foo)) | ||
(export "__em_js__foo" (global $__em_js__foo)) | ||
(export "__start_em_lib_deps" (global $em_lib_deps_start)) | ||
(export "__stop_em_lib_deps" (global $em_lib_deps_stop)) | ||
;; CHECK: (export "__start_foo" (global $foo_start)) | ||
(export "__start_foo" (global $foo_start)) | ||
;; CHECK: (export "__stop_foo" (global $foo_stop)) | ||
(export "__stop_foo" (global $foo_stop)) | ||
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,4 +41,3 @@ | |
;; CHECK: (export "__stop_foo" (global $foo_stop)) | ||
(export "__stop_foo" (global $foo_stop)) | ||
) | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this one not preserved in the output?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For EM_ASM we use the global start/stop symbols and split the resulting string on NULL.
For EM_JS each string is exported via its own global export e.g.
__em_js__foo
so we don't need the start/stop symbols.