[llvm-commits] CVS: llvm/test/Regression/Transforms/GlobalOpt/globalsra-partial.llx

Chris Lattner lattner at cs.uiuc.edu
Sun Oct 10 22:00:43 PDT 2004



Changes in directory llvm/test/Regression/Transforms/GlobalOpt:

globalsra-partial.llx added (r1.1)
---
Log message:

This testcase ensures that we can SRA a global even if part of the global
cannot be SRA'd


---
Diffs of the changes:  (+23 -0)

Index: llvm/test/Regression/Transforms/GlobalOpt/globalsra-partial.llx
diff -c /dev/null llvm/test/Regression/Transforms/GlobalOpt/globalsra-partial.llx:1.1
*** /dev/null	Mon Oct 11 00:00:40 2004
--- llvm/test/Regression/Transforms/GlobalOpt/globalsra-partial.llx	Mon Oct 11 00:00:30 2004
***************
*** 0 ****
--- 1,23 ----
+ ; In this case, the global can only be broken up by one level.
+ 
+ ; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep 12345
+ 
+ %G = internal global { int, [4 x float] } zeroinitializer
+ 
+ void %onlystore() {
+ 	store int 12345, int* getelementptr ({ int, [4 x float] }* %G, int 0, uint 0)
+ 	ret void
+ }
+ 
+ void %storeinit(int %i) {
+ 	%Ptr = getelementptr { int, [4 x float] }* %G, int 0, uint 1, int %i
+ 	store float 1.0, float* %Ptr
+ 	ret void
+ }
+ 
+ float %readval(int %i) {
+ 	%Ptr = getelementptr { int, [4 x float] }* %G, int 0, uint 1, int %i
+ 	%V = load float* %Ptr
+ 	ret float %V
+ }
+ 






More information about the llvm-commits mailing list