Files
llvm/lld/test/wasm/mutable-globals.s
Sam Clegg 3c45a06f26 [lld][WebAssembly] Allow exporting of mutable globals
In particular allow explict exporting of `__stack_pointer` but
exclud this from `--export-all` to avoid requiring the mutable
globals feature whenenve `--export-all` is used.

This uncovered a bug in populateTargetFeatures regarding checking
if the mutable-globals feature is allowed.

See: https://github.com/WebAssembly/binaryen/issues/2934

Differential Revision: https://reviews.llvm.org/D88506
2020-09-30 17:53:27 -07:00

17 lines
487 B
ArmAsm

# RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown -o %t.o %s
# RUN: not wasm-ld %t.o -o %t.wasm 2>&1 | FileCheck %s
# RUN: wasm-ld --features=mutable-globals %t.o -o %t.wasm
.globl _start
_start:
.functype _start () -> ()
i32.const 1
global.set foo
end_function
.globaltype foo, i32
.import_module foo, env
.import_name foo, foo
# CHECK: error: mutable global imported but 'mutable-globals' feature not present in inputs: `foo`. Use --no-check-features to suppress.