diff --git a/lld/test/wasm/tls-init-symbols.s b/lld/test/wasm/tls-init-symbols.s index 601766d681d85..944c9c349701a 100644 --- a/lld/test/wasm/tls-init-symbols.s +++ b/lld/test/wasm/tls-init-symbols.s @@ -9,6 +9,7 @@ # RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown -o %t.o %s # RUN: wasm-ld -no-gc-sections --shared-memory -o %t.wasm %t.o +# RUN: wasm-ld -no-gc-sections --shared-memory --extra-features=extended-const -o %t.extended.wasm %t.o # RUN: obj2yaml %t.wasm | FileCheck %s # RUN: llvm-objdump -d --no-show-raw-insn --no-leading-addr %t.wasm | FileCheck %s --check-prefixes DIS diff --git a/lld/wasm/SyntheticSections.cpp b/lld/wasm/SyntheticSections.cpp index 050f61c7f5c56..b6d572277e7cd 100644 --- a/lld/wasm/SyntheticSections.cpp +++ b/lld/wasm/SyntheticSections.cpp @@ -474,7 +474,7 @@ void GlobalSection::addInternalGOTEntry(Symbol *sym) { } void GlobalSection::generateRelocationCode(raw_ostream &os, bool TLS) const { - assert(!ctx.arg.extendedConst); + assert(!ctx.arg.extendedConst || TLS); bool is64 = ctx.arg.is64.value_or(false); unsigned opcode_ptr_add = is64 ? WASM_OPCODE_I64_ADD : WASM_OPCODE_I32_ADD;