blob: 9a76cfbc7a3125399e14d4641b46fb60d4e69d0a [file] [log] [blame]
Tanya Lattnercd0aa812004-11-06 21:40:51 +00001; RUN: llvm-as < %s | llc -march=c
2
Chris Lattneraa250b82002-08-26 20:49:42 +00003; Indirect function call test... found by Joel & Brian
4;
5
6%taskArray = uninitialized global int*
7
8void %test(int %X) {
9 %Y = add int %X, -1 ; <int>:1 [#uses=3]
Chris Lattner5139f2b2003-10-23 16:01:03 +000010 %cast100 = cast int %Y to long ; <uint> [#uses=1]
11 %gep100 = getelementptr int** %taskArray, long %cast100 ; <int**> [#uses=1]
Chris Lattneraa250b82002-08-26 20:49:42 +000012 %fooPtr = load int** %gep100 ; <int*> [#uses=1]
13 %cast101 = cast int* %fooPtr to void (int)* ; <void (int)*> [#uses=1]
14 call void %cast101( int 1000 )
15 ret void
16}