blob: 35a2c5fcb151ac074d55a5ba5982a8e8a2fd9920 [file] [log] [blame]
Chris Lattnere4ae94c2002-11-17 21:06:13 +00001
Chris Lattnere1ac72a2003-01-13 00:57:04 +00002void %test(sbyte* %P, short* %P, int* %P, long* %P) {
Chris Lattnere4ae94c2002-11-17 21:06:13 +00003 %V = load sbyte* %P
4 store sbyte %V, sbyte* %P
5
6 %V = load short* %P
7 store short %V, short* %P
8
9 %V = load int* %P
10 store int %V, int* %P
Chris Lattnere1ac72a2003-01-13 00:57:04 +000011
12 %V = load long* %P
13 store long %V, long* %P
14
Chris Lattnere4ae94c2002-11-17 21:06:13 +000015 ret void
16}
Chris Lattner9f1bd802002-12-04 17:15:07 +000017
Chris Lattnerce675472002-12-28 20:00:33 +000018uint %varalloca(uint %Size) {
19 %X = alloca uint, uint %Size ;; Variable sized alloca
20 store uint %Size, uint* %X
21 %Y = load uint* %X
22 ret uint %Y
23}
24
Brian Gaekeed6902c2002-12-13 09:28:50 +000025int %main() {
Chris Lattner9f1bd802002-12-04 17:15:07 +000026 %A = alloca sbyte
27 %B = alloca short
28 %C = alloca int
Chris Lattnere1ac72a2003-01-13 00:57:04 +000029 %D = alloca long
30 call void %test(sbyte* %A, short* %B, int* %C, long* %D)
Chris Lattnerce675472002-12-28 20:00:33 +000031 call uint %varalloca(uint 7)
32
Brian Gaekeed6902c2002-12-13 09:28:50 +000033 ret int 0
Chris Lattner9f1bd802002-12-04 17:15:07 +000034}