blob: bf592ce3f6fb06703f8e402da7c207418c41bb45 [file] [log] [blame]
Tanya Lattner53a66d12008-02-19 01:41:04 +00001; RUN: llvm-as < %s | llc -march=c
Tanya Lattnercd0aa812004-11-06 21:40:51 +00002
Chris Lattneraa250b82002-08-26 20:49:42 +00003; Indirect function call test... found by Joel & Brian
4;
5
Tanya Lattner53a66d12008-02-19 01:41:04 +00006@taskArray = external global i32* ; <i32**> [#uses=1]
Chris Lattneraa250b82002-08-26 20:49:42 +00007
Tanya Lattner53a66d12008-02-19 01:41:04 +00008define void @test(i32 %X) {
9 %Y = add i32 %X, -1 ; <i32> [#uses=1]
10 %cast100 = sext i32 %Y to i64 ; <i64> [#uses=1]
11 %gep100 = getelementptr i32** @taskArray, i64 %cast100 ; <i32**> [#uses=1]
12 %fooPtr = load i32** %gep100 ; <i32*> [#uses=1]
13 %cast101 = bitcast i32* %fooPtr to void (i32)* ; <void (i32)*> [#uses=1]
14 call void %cast101( i32 1000 )
15 ret void
Chris Lattneraa250b82002-08-26 20:49:42 +000016}
Tanya Lattner53a66d12008-02-19 01:41:04 +000017