blob: abfe90048fee4018f4010929f5b225d7fd66129a [file] [edit]
; 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
; __safestack_unsafe_stack_ptr already exists, but is not thread local.
@__safestack_unsafe_stack_ptr = external global ptr
; ERR: error: __safestack_unsafe_stack_ptr must be thread-local
; CHECK-LABEL: define void @foo(
; CHECK: [[USP:%.*]] = load ptr, ptr @__safestack_unsafe_stack_ptr
; CHECK: store ptr {{%.*}}, ptr @__safestack_unsafe_stack_ptr
; CHECK: store ptr [[USP]], ptr @__safestack_unsafe_stack_ptr
define void @foo() nounwind uwtable safestack {
%a = alloca i8, align 8
call void @Capture(ptr %a)
ret void
}
declare void @Capture(ptr)