Add a couple new testcases.

llvm-svn: 84385
This commit is contained in:
Nick Lewycky 2009-10-18 00:42:07 +00:00
parent ec411e9199
commit 91ea404e98
2 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,17 @@
; RUN: opt -S -gvn -dse < %s | FileCheck %s
declare void @llvm.memcpy.i8(i8*, i8*, i8, i32)
define i8 @test1() {
; CHECK: @test1
%A = alloca i8
%B = alloca i8
store i8 2, i8* %B ;; Not written to by memcpy
call void @llvm.memcpy.i8(i8* %A, i8* %B, i8 -1, i32 0)
%C = load i8* %B
ret i8 %C
; CHECK-NEXT: ret i8 2
}

View File

@ -0,0 +1,13 @@
; RUN: opt -S -gvn < %s | FileCheck %s
declare void @llvm.memset.i8(i8*, i8, i8, i32)
define i8 @test(i8* %P) {
%P2 = getelementptr i8* %P, i32 1000
store i8 1, i8* %P2 ;; Not dead across memset
call void @llvm.memset.i8(i8* %P, i8 2, i8 127, i32 0)
%A = load i8* %P2
ret i8 %A
; CHECK: ret i8 1
}