mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-20 12:31:40 +00:00
This testcase ensures that we can SRA a global even if part of the global
cannot be SRA'd git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16915 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
95d0bbfda6
commit
c58cf5b921
23
test/Transforms/GlobalOpt/globalsra-partial.llx
Normal file
23
test/Transforms/GlobalOpt/globalsra-partial.llx
Normal file
@ -0,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
|
||||||
|
}
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user