blob: ac558b0185528af1d9db8dbcb2578ace8e6a4d22 [file] [log] [blame]
Tanya Lattnere9789ef2004-11-06 23:32:43 +00001; RUN: llvm-as -f %s -o %t.bc
2; RUN: lli %t.bc > /dev/null
3
Chris Lattnere4ae94c2002-11-17 21:06:13 +00004
Chris Lattnere1ac72a2003-01-13 00:57:04 +00005void %test(sbyte* %P, short* %P, int* %P, long* %P) {
Chris Lattnere4ae94c2002-11-17 21:06:13 +00006 %V = load sbyte* %P
7 store sbyte %V, sbyte* %P
8
9 %V = load short* %P
10 store short %V, short* %P
11
12 %V = load int* %P
13 store int %V, int* %P
Chris Lattnere1ac72a2003-01-13 00:57:04 +000014
15 %V = load long* %P
16 store long %V, long* %P
17
Chris Lattnere4ae94c2002-11-17 21:06:13 +000018 ret void
19}
Chris Lattner9f1bd802002-12-04 17:15:07 +000020
Chris Lattnerce675472002-12-28 20:00:33 +000021uint %varalloca(uint %Size) {
22 %X = alloca uint, uint %Size ;; Variable sized alloca
23 store uint %Size, uint* %X
24 %Y = load uint* %X
25 ret uint %Y
26}
27
Brian Gaekeed6902c2002-12-13 09:28:50 +000028int %main() {
Chris Lattner9f1bd802002-12-04 17:15:07 +000029 %A = alloca sbyte
30 %B = alloca short
31 %C = alloca int
Chris Lattnere1ac72a2003-01-13 00:57:04 +000032 %D = alloca long
33 call void %test(sbyte* %A, short* %B, int* %C, long* %D)
Chris Lattnerce675472002-12-28 20:00:33 +000034 call uint %varalloca(uint 7)
35
Brian Gaekeed6902c2002-12-13 09:28:50 +000036 ret int 0
Chris Lattner9f1bd802002-12-04 17:15:07 +000037}