From 6e85d91144ef563963be2782a5561a1a6bb088b8 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 18 Oct 2009 04:50:18 +0000 Subject: tighten test2, add a test that it doesn't get transformed in the invalid edge case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84401 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Analysis/BasicAA/modref.ll | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/test/Analysis/BasicAA/modref.ll b/test/Analysis/BasicAA/modref.ll index b3d93ac..a089864 100644 --- a/test/Analysis/BasicAA/modref.ll +++ b/test/Analysis/BasicAA/modref.ll @@ -40,7 +40,7 @@ define i8 @test1() { define i8 @test2(i8* %P) { ; CHECK: @test2 - %P2 = getelementptr i8* %P, i32 1000 + %P2 = getelementptr i8* %P, i32 127 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 @@ -48,6 +48,17 @@ define i8 @test2(i8* %P) { ; CHECK: ret i8 1 } +define i8 @test2a(i8* %P) { +; CHECK: @test2 + %P2 = getelementptr i8* %P, i32 126 + store i8 1, i8* %P2 ;; Dead, clobbered by memset. + call void @llvm.memset.i8(i8* %P, i8 2, i8 127, i32 0) + %A = load i8* %P2 + ret i8 %A +; CHECK: %A = load i8* %P2 +; CHECK: ret i8 %A +} + define void @test3(i8* %P) { ; CHECK: @test3 %P2 = getelementptr i8* %P, i32 2 -- cgit v1.1