[clang] [llvm] [WebAssembly] Change to 64-bit table indices on Wasm64 (PR #180649)

Demetrius Kanios via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 26 01:10:53 PDT 2026


================
@@ -0,0 +1,72 @@
+; RUN: llc --mtriple=wasm32-unknown-unknown -filetype=obj %s -o - | obj2yaml | FileCheck --check-prefixes CHECK %s
+; RUN: llc --mtriple=wasm64-unknown-unknown -filetype=obj %s -o - | obj2yaml | FileCheck --check-prefixes CHECK,WASM64 %s
+
+; Ensure that tables generated through `llc` are in the correct address mode
+
+
+%externref = type ptr addrspace(10)
+ at externref_table = local_unnamed_addr addrspace(1) global [0 x %externref] undef
----------------
QuantumSegfault wrote:

What would be the proper solution to remove `undef` here?

Should I just use an empty array initializer (kind of like using `0` for Wasm globals; technically ignored, but matches final behavior in practice)?

https://github.com/llvm/llvm-project/pull/180649


More information about the cfe-commits mailing list