[llvm-commits] [llvm] r56344 - /llvm/trunk/test/Transforms/AddReadAttrs/2008-09-03-ReadNone.ll

Duncan Sands baldrick at free.fr
Fri Sep 19 02:20:06 PDT 2008


Author: baldrick
Date: Fri Sep 19 04:20:05 2008
New Revision: 56344

URL: http://llvm.org/viewvc/llvm-project?rev=56344&view=rev
Log:
Add test for improvement of readonly to readnone,
and non-demotion of readnone to readonly.

Modified:
    llvm/trunk/test/Transforms/AddReadAttrs/2008-09-03-ReadNone.ll

Modified: llvm/trunk/test/Transforms/AddReadAttrs/2008-09-03-ReadNone.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/AddReadAttrs/2008-09-03-ReadNone.ll?rev=56344&r1=56343&r2=56344&view=diff

==============================================================================
--- llvm/trunk/test/Transforms/AddReadAttrs/2008-09-03-ReadNone.ll (original)
+++ llvm/trunk/test/Transforms/AddReadAttrs/2008-09-03-ReadNone.ll Fri Sep 19 04:20:05 2008
@@ -1,9 +1,18 @@
-; RUN: llvm-as < %s | opt -addreadattrs | llvm-dis | grep readnone | count 2
+; RUN: llvm-as < %s | opt -addreadattrs | llvm-dis | grep readnone | count 4
+ at x = global i32 0
+
+declare i32 @e() readnone
 
 define i32 @f() {
-entry:
 	%tmp = call i32 @e( )		; <i32> [#uses=1]
 	ret i32 %tmp
 }
 
-declare i32 @e() readnone
+define i32 @g() readonly {
+	ret i32 0
+}
+
+define i32 @h() readnone {
+	%tmp = load i32* @x		; <i32> [#uses=1]
+	ret i32 %tmp
+}





More information about the llvm-commits mailing list