diff options
| author | Thomas Lively <tlively@google.com> | 2019-10-15 19:05:11 +0000 |
|---|---|---|
| committer | Thomas Lively <tlively@google.com> | 2019-10-15 19:05:11 +0000 |
| commit | 190dacc3cc206fa90a44e2f4aa6b56c327d1942a (patch) | |
| tree | c6efda90caff32ebc4ad49c538b1bf2a020d2aa6 /lld/test/wasm/custom-section-name.ll | |
| parent | 0330fba6e16db9b5d2079313646f93485c5ccf39 (diff) | |
| download | bcm5719-llvm-190dacc3cc206fa90a44e2f4aa6b56c327d1942a.tar.gz bcm5719-llvm-190dacc3cc206fa90a44e2f4aa6b56c327d1942a.zip | |
[WebAssembly] Elide data segments for .bss sections
Summary:
WebAssembly memories are zero-initialized, so when module does not
import its memory initializing .bss sections is guaranteed to be a
no-op. To reduce binary size and initialization time, .bss sections
are simply not emitted into the final binary unless the memory is
imported.
Reviewers: sbc100
Subscribers: dschuff, jgravelle-google, aheejin, sunfish, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68965
llvm-svn: 374940
Diffstat (limited to 'lld/test/wasm/custom-section-name.ll')
| -rw-r--r-- | lld/test/wasm/custom-section-name.ll | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/lld/test/wasm/custom-section-name.ll b/lld/test/wasm/custom-section-name.ll index 2d46810b137..b860ef5a83e 100644 --- a/lld/test/wasm/custom-section-name.ll +++ b/lld/test/wasm/custom-section-name.ll @@ -1,6 +1,8 @@ ; RUN: llc -filetype=obj %s -o %t.o ; RUN: wasm-ld -no-gc-sections --no-entry -o %t.wasm %t.o -; RUN: obj2yaml %t.wasm | FileCheck %s +; RUN: obj2yaml %t.wasm | FileCheck %s --check-prefixes=CHECK,NO-BSS +; RUN: wasm-ld -no-gc-sections --no-entry --import-memory -o %t.bss.wasm %t.o +; RUN: obj2yaml %t.bss.wasm | FileCheck %s --check-prefixes=CHECK,BSS ; RUN: wasm-ld -no-gc-sections --no-entry -o %t_reloc.o %t.o --relocatable ; RUN: obj2yaml %t_reloc.o | FileCheck -check-prefix RELOC %s @@ -32,12 +34,13 @@ target triple = "wasm32-unknown-unknown" ; CHECK-NEXT: Opcode: I32_CONST ; CHECK-NEXT: Value: 1032 ; CHECK-NEXT: Content: '07000000' -; CHECK-NEXT: - SectionOffset: 37 -; CHECK-NEXT: InitFlags: 0 -; CHECK-NEXT: Offset: -; CHECK-NEXT: Opcode: I32_CONST -; CHECK-NEXT: Value: 1036 -; CHECK-NEXT: Content: '00000000' +; BSS-NEXT: - SectionOffset: 37 +; BSS-NEXT: InitFlags: 0 +; BSS-NEXT: Offset: +; BSS-NEXT: Opcode: I32_CONST +; BSS-NEXT: Value: 1036 +; BSS-NEXT: Content: '00000000' +; NO-BSS-NOT: - SectionOffset: ; RELOC-LABEL: SegmentInfo: ; RELOC-NEXT: - Index: 0 |

