replace a useless test with a useful one
authorChris Lattner <sabre@nondot.org>
Sat, 17 Oct 2009 23:59:51 +0000 (23:59 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 17 Oct 2009 23:59:51 +0000 (23:59 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84383 91177308-0d34-0410-b5e6-96231b3b80d8

test/Analysis/BasicAA/modref.ll

index 8f7c0a75d52e0ab3ec865cc9a2f836ef178ff254..54d415e060e372426c4ed4b26acfc1c2dd09c26b 100644 (file)
@@ -1,15 +1,21 @@
-; A very rudimentary test on AliasAnalysis::getModRefInfo.
-; RUN: opt < %s -print-all-alias-modref-info -aa-eval -disable-output |& \
-; RUN: not grep NoModRef
-
-define i32 @callee() {
-        %X = alloca { i32, i32 }                ; <{ i32, i32 }*> [#uses=1]
-        %Y = getelementptr { i32, i32 }* %X, i64 0, i32 0               ; <i32*> [#uses=1]
-        %Z = load i32* %Y               ; <i32> [#uses=1]
-        ret i32 %Z
-}
+; RUN: opt < %s -basicaa -gvn -S | FileCheck %s
+
+declare void @llvm.memset.i32(i8*, i8, i32, i32)
 
-define i32 @caller() {
-        %X = call i32 @callee( )                ; <i32> [#uses=1]
-        ret i32 %X
+declare void @external(i32*) 
+
+define i32 @test0(i8* %P) {
+  %A = alloca i32
+  call void @external(i32* %A)
+  
+  store i32 0, i32* %A
+  
+  call void @llvm.memset.i32(i8* %P, i8 0, i32 42, i32 1)
+  
+  %B = load i32* %A
+  ret i32 %B
+  
+; CHECK: @test0
+; CHECK: ret i32 0
 }
+