mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 18:54:02 +01:00
e8be0ee828
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
12 lines
386 B
LLVM
12 lines
386 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 i32 @externref_to_int(%externref %ref) {
|
|
%i = ptrtoint %externref %ref to i32
|
|
ret i32 %i
|
|
}
|
|
|
|
; CHECK-ERROR: LLVM ERROR: ptrtoint not allowed on reference types
|