Since D101045, allocas are no longer required to be part of the default alloca address space. There may be allocas in multiple different address spaces. However, the bitcode reader would simply assume the default alloca address space, resulting in either an error or incorrect IR. Add an optional record for allocas which encodes the address space.
19 lines
539 B
LLVM
19 lines
539 B
LLVM
; RUN: llvm-as < %s | llvm-dis | FileCheck %s
|
|
|
|
target datalayout = "A2"
|
|
|
|
; CHECK-LABEL: define i8 addrspace(2)* @alloca_addrspace_2() {
|
|
; CHECK: %alloca = alloca i8, align 1, addrspace(2)
|
|
define i8 addrspace(2)* @alloca_addrspace_2() {
|
|
%alloca = alloca i8, addrspace(2)
|
|
ret i8 addrspace(2)* %alloca
|
|
}
|
|
|
|
; CHECK-LABEL: define i8 addrspace(5)* @alloca_addrspace_5() {
|
|
; CHECK: %alloca = alloca i8, align 1, addrspace(5)
|
|
define i8 addrspace(5)* @alloca_addrspace_5() {
|
|
%alloca = alloca i8, addrspace(5)
|
|
ret i8 addrspace(5)* %alloca
|
|
}
|
|
|