Changeset View
Changeset View
Standalone View
Standalone View
lld/test/wasm/data-segments.ll
; RUN: llc -filetype=obj %s -o %t.atomics.o -mattr=+atomics | ; RUN: llc -filetype=obj %s -o %t.atomics.o -mattr=+atomics | ||||
; RUN: llc -filetype=obj %s -o %t.bulk-mem.o -mattr=+bulk-memory | ; RUN: llc -filetype=obj %s -o %t.bulk-mem.o -mattr=+bulk-memory | ||||
; RUN: llc -filetype=obj %s -o %t.atomics.bulk-mem.o -mattr=+atomics,+bulk-memory | ; RUN: llc -filetype=obj %s -o %t.atomics.bulk-mem.o -mattr=+atomics,+bulk-memory | ||||
; atomics => active segments (TODO: error) | ; atomics => active segments (TODO: error) | ||||
; RUN: wasm-ld -no-gc-sections --no-entry --shared-memory --max-memory=131072 %t.atomics.o -o %t.atomics.wasm | ; RUN: wasm-ld -no-gc-sections --no-entry --shared-memory --max-memory=131072 %t.atomics.o -o %t.atomics.wasm | ||||
; RUN: obj2yaml %t.atomics.wasm | FileCheck %s --check-prefix ACTIVE | ; RUN: obj2yaml %t.atomics.wasm | FileCheck %s --check-prefix ACTIVE | ||||
aheejin: What is the difference between `ACTIVE` and `ACTIVE-TLS`? It looks we don't have different… | |||||
ACTIVE-TLS is for builds with TLS enabled. Currently, we use --shared-memory to determine that, per @tlively's recommendation. The rationale is that we don't want even more flags that need to be passed in a proper threaded build. quantum: `ACTIVE-TLS` is for builds with TLS enabled. Currently, we use `--shared-memory` to determine… | |||||
Then if we don't enable --shared-memory, we don't generate those globals? Do we have a test for that? aheejin: Then if we don't enable `--shared-memory`, we don't generate those globals? Do we have a test… | |||||
Yes. In this file, the cases with --check-prefix ACTIVE will ensure that the fields are not generated. quantum: Yes. In this file, the cases with `--check-prefix ACTIVE` will ensure that the fields are not… | |||||
; atomics, active segments => active segments | ; atomics, active segments => active segments | ||||
; RUN: wasm-ld -no-gc-sections --no-entry --shared-memory --max-memory=131072 --active-segments %t.atomics.o -o %t.atomics.active.wasm | ; RUN: wasm-ld -no-gc-sections --no-entry --shared-memory --max-memory=131072 --active-segments %t.atomics.o -o %t.atomics.active.wasm | ||||
; RUN: obj2yaml %t.atomics.active.wasm | FileCheck %s --check-prefix ACTIVE | ; RUN: obj2yaml %t.atomics.active.wasm | FileCheck %s --check-prefix ACTIVE | ||||
; atomics, passive segments => error | ; atomics, passive segments => error | ||||
; RUN: not wasm-ld -no-gc-sections --no-entry --shared-memory --max-memory=131072 --passive-segments %t.atomics.o -o %t.atomics.passive.wasm 2>&1 | FileCheck %s --check-prefix ERROR | ; RUN: not wasm-ld -no-gc-sections --no-entry --shared-memory --max-memory=131072 --passive-segments %t.atomics.o -o %t.atomics.passive.wasm 2>&1 | FileCheck %s --check-prefix ERROR | ||||
Show All 33 Lines | |||||
; ERROR: 'bulk-memory' feature must be used in order to emit passive segments | ; ERROR: 'bulk-memory' feature must be used in order to emit passive segments | ||||
; ACTIVE-LABEL: - Type: CODE | ; ACTIVE-LABEL: - Type: CODE | ||||
; ACTIVE-NEXT: Functions: | ; ACTIVE-NEXT: Functions: | ||||
; ACTIVE-NEXT: - Index: 0 | ; ACTIVE-NEXT: - Index: 0 | ||||
; ACTIVE-NEXT: Locals: [] | ; ACTIVE-NEXT: Locals: [] | ||||
; ACTIVE-NEXT: Body: 0B | ; ACTIVE-NEXT: Body: 0B | ||||
; ACTIVE-NEXT: - Index: 1 | |||||
; ACTIVE-NEXT: Locals: [] | |||||
; ACTIVE-NEXT: Body: 0B | |||||
; ACTIVE-NEXT: - Type: DATA | ; ACTIVE-NEXT: - Type: DATA | ||||
; ACTIVE-NEXT: Segments: | ; ACTIVE-NEXT: Segments: | ||||
; ACTIVE-NEXT: - SectionOffset: 7 | ; ACTIVE-NEXT: - SectionOffset: 7 | ||||
; ACTIVE-NEXT: InitFlags: 0 | ; ACTIVE-NEXT: InitFlags: 0 | ||||
; ACTIVE-NEXT: Offset: | ; ACTIVE-NEXT: Offset: | ||||
; ACTIVE-NEXT: Opcode: I32_CONST | ; ACTIVE-NEXT: Opcode: I32_CONST | ||||
; ACTIVE-NEXT: Value: 1024 | ; ACTIVE-NEXT: Value: 1024 | ||||
; ACTIVE-NEXT: Content: 68656C6C6F00676F6F6462796500776861746576657200002A000000 | ; ACTIVE-NEXT: Content: 68656C6C6F00676F6F6462796500776861746576657200002A000000 | ||||
; ACTIVE-NEXT: - SectionOffset: 41 | ; ACTIVE-NEXT: - SectionOffset: 41 | ||||
; ACTIVE-NEXT: InitFlags: 0 | ; ACTIVE-NEXT: InitFlags: 0 | ||||
; ACTIVE-NEXT: Offset: | ; ACTIVE-NEXT: Offset: | ||||
; ACTIVE-NEXT: Opcode: I32_CONST | ; ACTIVE-NEXT: Opcode: I32_CONST | ||||
; ACTIVE-NEXT: Value: 1052 | ; ACTIVE-NEXT: Value: 1052 | ||||
; ACTIVE-NEXT: Content: 636F6E7374616E74000000002B | ; ACTIVE-NEXT: Content: 636F6E7374616E74000000002B | ||||
; ACTIVE-NEXT: - Type: CUSTOM | ; ACTIVE-NEXT: - Type: CUSTOM | ||||
; ACTIVE-NEXT: Name: name | ; ACTIVE-NEXT: Name: name | ||||
; ACTIVE-NEXT: FunctionNames: | ; ACTIVE-NEXT: FunctionNames: | ||||
; ACTIVE-NEXT: - Index: 0 | ; ACTIVE-NEXT: - Index: 0 | ||||
; ACTIVE-NEXT: Name: __wasm_call_ctors | ; ACTIVE-NEXT: Name: __wasm_call_ctors | ||||
; ACTIVE-NEXT: - Index: 1 | |||||
; ACTIVE-NEXT: Name: __wasm_init_tls | |||||
; PASSIVE-LABEL: - Type: CODE | ; PASSIVE-LABEL: - Type: CODE | ||||
; PASSIVE-NEXT: Functions: | ; PASSIVE-NEXT: Functions: | ||||
; PASSIVE-NEXT: - Index: 0 | ; PASSIVE-NEXT: - Index: 0 | ||||
; PASSIVE-NEXT: Locals: [] | ; PASSIVE-NEXT: Locals: [] | ||||
; PASSIVE-NEXT: Body: 10010B | ; PASSIVE-NEXT: Body: 10010B | ||||
; PASSIVE-NEXT: - Index: 1 | ; PASSIVE-NEXT: - Index: 1 | ||||
; PASSIVE-NEXT: Locals: [] | ; PASSIVE-NEXT: Locals: [] | ||||
; PASSIVE-NEXT: Body: 4180084100411CFC080000FC0900419C084100410DFC080100FC09010B | ; PASSIVE-NEXT: Body: 4180084100411CFC080000FC0900419C084100410DFC080100FC09010B | ||||
; PASSIVE-NEXT: - Index: 2 | |||||
; PASSIVE-NEXT: Locals: [] | |||||
; PASSIVE-NEXT: Body: 0B | |||||
; PASSIVE-NEXT: - Type: DATA | ; PASSIVE-NEXT: - Type: DATA | ||||
; PASSIVE-NEXT: Segments: | ; PASSIVE-NEXT: Segments: | ||||
; PASSIVE-NEXT: - SectionOffset: 3 | ; PASSIVE-NEXT: - SectionOffset: 3 | ||||
; PASSIVE-NEXT: InitFlags: 1 | ; PASSIVE-NEXT: InitFlags: 1 | ||||
; PASSIVE-NEXT: Content: 68656C6C6F00676F6F6462796500776861746576657200002A000000 | ; PASSIVE-NEXT: Content: 68656C6C6F00676F6F6462796500776861746576657200002A000000 | ||||
; PASSIVE-NEXT: - SectionOffset: 33 | ; PASSIVE-NEXT: - SectionOffset: 33 | ||||
; PASSIVE-NEXT: InitFlags: 1 | ; PASSIVE-NEXT: InitFlags: 1 | ||||
; PASSIVE-NEXT: Content: 636F6E7374616E74000000002B | ; PASSIVE-NEXT: Content: 636F6E7374616E74000000002B | ||||
; PASSIVE-NEXT: - Type: CUSTOM | ; PASSIVE-NEXT: - Type: CUSTOM | ||||
; PASSIVE-NEXT: Name: name | ; PASSIVE-NEXT: Name: name | ||||
; PASSIVE-NEXT: FunctionNames: | ; PASSIVE-NEXT: FunctionNames: | ||||
; PASSIVE-NEXT: - Index: 0 | ; PASSIVE-NEXT: - Index: 0 | ||||
; PASSIVE-NEXT: Name: __wasm_call_ctors | ; PASSIVE-NEXT: Name: __wasm_call_ctors | ||||
; PASSIVE-NEXT: - Index: 1 | ; PASSIVE-NEXT: - Index: 1 | ||||
; PASSIVE-NEXT: Name: __wasm_init_memory | ; PASSIVE-NEXT: Name: __wasm_init_memory | ||||
; PASSIVE-NEXT: - Index: 2 | |||||
; PASSIVE-NEXT: Name: __wasm_init_tls |
What is the difference between ACTIVE and ACTIVE-TLS? It looks we don't have different build processes for them. And as what @sbc100 said, can we exclude TLS from build?