1
0
mirror of https://github.com/c64scene-ar/llvm-6502.git synced 2024-12-21 16:31:16 +00:00
llvm-6502/test/CodeGen/CBackend/2002-08-26-IndirectCallTest.ll
Tanya Lattner 53a66d10f0 Remove llvm-upgrade and update tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47296 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19 01:41:04 +00:00

18 lines
623 B
LLVM

; RUN: llvm-as < %s | llc -march=c
; Indirect function call test... found by Joel & Brian
;
@taskArray = external global i32* ; <i32**> [#uses=1]
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
}