llvm-project/llvm/test/Assembler/invalid-addrspace.ll
Luke Lau 247ecc99e4 [AsmParser] Check that addrspace fits within 24 bits
Address spaces equal or larger than 1 << 24 don't fit and produce an
assertion during debug builds, or worse in release. This causes an error
to be reported during parsing instead.

Differential Revision: https://reviews.llvm.org/D139528
2022-12-09 09:53:42 +00:00

9 lines
257 B
LLVM

; RUN: not llvm-as < %s 2>&1 | FileCheck %s
; Check that parser rejects address spaces that are too large to fit in the 24 bits
define void @f() {
; CHECK: invalid address space, must be a 24-bit integer
%y = alloca i32, addrspace(16777216)
ret void
}