mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-07 12:28:24 +00:00
Add a variable sized alloca to test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5158 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -11,10 +11,19 @@ void %test(sbyte* %P, short* %P, int* %P) {
|
|||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint %varalloca(uint %Size) {
|
||||||
|
%X = alloca uint, uint %Size ;; Variable sized alloca
|
||||||
|
store uint %Size, uint* %X
|
||||||
|
%Y = load uint* %X
|
||||||
|
ret uint %Y
|
||||||
|
}
|
||||||
|
|
||||||
int %main() {
|
int %main() {
|
||||||
%A = alloca sbyte
|
%A = alloca sbyte
|
||||||
%B = alloca short
|
%B = alloca short
|
||||||
%C = alloca int
|
%C = alloca int
|
||||||
call void %test(sbyte* %A, short* %B, int* %C)
|
call void %test(sbyte* %A, short* %B, int* %C)
|
||||||
|
call uint %varalloca(uint 7)
|
||||||
|
|
||||||
ret int 0
|
ret int 0
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user