llvm-project/llvm/test/Bitcode/alloca-addrspace.ll
Nikita Popov e45cf47923 [Bitcode] Remove auto-detection for typed pointers
Always read bitcode according to the -opaque-pointers mode. Do not
perform auto-detection to implicitly switch to typed pointers.

This is a step towards removing typed pointer support, and also
eliminates the class of problems where linking may fail if a typed
pointer module is loaded before an opaque pointer module. (The
latest place where this was encountered is D139924, but this has
previously been fixed in other places doing bitcode linking as well.)

Differential Revision: https://reviews.llvm.org/D139940
2022-12-14 13:38:20 +01:00

19 lines
539 B
LLVM

; RUN: llvm-as < %s | llvm-dis | FileCheck %s
target datalayout = "A2"
; CHECK-LABEL: define ptr 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 ptr 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
}