llvm-project/llvm/test/CodeGen/WebAssembly/externref-unsized-store.ll
Paulo Matos 46667a1003 [WebAssembly] Implementation of global.get/set for reftypes in LLVM IR
Reland of 31859f896.

This change implements new DAG notes GLOBAL_GET/GLOBAL_SET, and
lowering methods for load and stores of reference types from IR
globals. Once the lowering creates the new nodes, tablegen pattern
matches those and converts them to Wasm global.get/set.

Reviewed By: tlively

Differential Revision: https://reviews.llvm.org/D104797
2021-07-22 22:07:24 +02:00

12 lines
365 B
LLVM

; RUN: not llc --mtriple=wasm32-unknown-unknown -asm-verbose=false -mattr=+reference-types < %s 2>&1 | FileCheck %s --check-prefix=CHECK-ERROR
%extern = type opaque
%externref = type %extern addrspace(10)*
define void @store_extern(%externref %ref) {
store %extern undef, %externref %ref
ret void
}
; CHECK-ERROR: error: storing unsized types is not allowed