llvm/llvm/test/Transforms/Inline/lifetime-no-datalayout.ll

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2
; RUN: opt -passes=inline -S < %s | FileCheck %s

declare void @use(ptr %a)

define void @helper() {
; CHECK-LABEL: define void @helper() {
; CHECK-NEXT:    [[A:%.*]] = alloca i8, align 1
; CHECK-NEXT:    call void @use(ptr [[A]])
; CHECK-NEXT:    ret void
;
  %a = alloca i8
  call void @use(ptr %a)
  ret void
}

; Size in llvm.lifetime.X should be 1 (default for i8).
define void @test() {
; CHECK-LABEL: define void @test() {
; CHECK-NEXT:    [[A_I:%.*]] = alloca i8, align 1
; CHECK-NEXT:    call void @llvm.lifetime.start.p0(i64 1, ptr [[A_I]])
; CHECK-NEXT:    call void @use(ptr [[A_I]])
; CHECK-NEXT:    call void @llvm.lifetime.end.p0(i64 1, ptr [[A_I]])
; CHECK-NEXT:    ret void
;
  call void @helper()
  ret void
}