Files
clang-p2996/llvm/test/CodeGen/WebAssembly/externref-inttoptr.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
393 B
LLVM

; RUN: not --crash 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 %externref @int_to_externref(i32 %i) {
%ref = inttoptr i32 %i to %externref
ret %externref %ref
}
; CHECK-ERROR: LLVM ERROR: inttoptr not allowed on reference types