2008-02-19 01:41:04 +00:00
|
|
|
; RUN: llvm-as < %s | llc -march=c
|
2004-11-06 21:40:51 +00:00
|
|
|
|
2002-08-26 20:49:42 +00:00
|
|
|
; Indirect function call test... found by Joel & Brian
|
|
|
|
;
|
|
|
|
|
2008-02-19 01:41:04 +00:00
|
|
|
@taskArray = external global i32* ; <i32**> [#uses=1]
|
2002-08-26 20:49:42 +00:00
|
|
|
|
2008-02-19 01:41:04 +00:00
|
|
|
define void @test(i32 %X) {
|
|
|
|
%Y = add i32 %X, -1 ; <i32> [#uses=1]
|
|
|
|
%cast100 = sext i32 %Y to i64 ; <i64> [#uses=1]
|
|
|
|
%gep100 = getelementptr i32** @taskArray, i64 %cast100 ; <i32**> [#uses=1]
|
|
|
|
%fooPtr = load i32** %gep100 ; <i32*> [#uses=1]
|
|
|
|
%cast101 = bitcast i32* %fooPtr to void (i32)* ; <void (i32)*> [#uses=1]
|
|
|
|
call void %cast101( i32 1000 )
|
|
|
|
ret void
|
2002-08-26 20:49:42 +00:00
|
|
|
}
|
2008-02-19 01:41:04 +00:00
|
|
|
|