llvm/llvm/test/Transforms/NewGVN/pr24426.ll

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
; RUN: opt < %s -passes=memcpyopt,mldst-motion,newgvn -S | FileCheck %s

declare void @check(i8)

declare void @write(ptr %res)

define void @test1() {
; CHECK-LABEL: define void @test1() {
; CHECK-NEXT:    [[TMP1:%.*]] = alloca [10 x i8], align 1
; CHECK-NEXT:    call void @write(ptr [[TMP1]])
; CHECK-NEXT:    [[TMP2:%.*]] = load i8, ptr [[TMP1]], align 1
; CHECK-NEXT:    call void @check(i8 [[TMP2]])
; CHECK-NEXT:    ret void
;
  %1 = alloca [10 x i8]
  call void @write(ptr %1)
  %2 = load i8, ptr %1

  call void @check(i8 %2)

  ret void
}