blob: 173ce220dd7e76d19662c84b618124cfbca6ed25 [file]
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: not opt -passes='require<libcall-lowering-info>,safe-stack' -mtriple=x86_64-pc-linux-gnu -S %s 2> %t.err | FileCheck %s
; RUN: FileCheck --check-prefix=ERR --implicit-check-not=error %s < %t.err
target datalayout = "A5"
; Declaration of __safestack_unsafe_stack_ptr already exists with wrong address space
@__safestack_unsafe_stack_ptr = external thread_local(initialexec) global ptr
; ERR: error: __safestack_unsafe_stack_ptr must have type ptr addrspace(5)
; CHECK-LABEL: define void @alloca_addrspace(
; CHECK: [[USP:%.*]] = load ptr addrspace(5), ptr @__safestack_unsafe_stack_ptr
; CHECK: store ptr addrspace(5) {{%.*}}, ptr @__safestack_unsafe_stack_ptr
; CHECK: store ptr addrspace(5) [[USP]], ptr @__safestack_unsafe_stack_ptr
define void @alloca_addrspace() nounwind uwtable safestack {
%a = alloca i8, align 8, addrspace(5)
call void @Capture_as5(ptr addrspace(5) %a)
ret void
}
declare void @Capture_as5(ptr addrspace(5))