blob: 645396fe7585aab019bef74b1a341e25c9e8312c [file] [log] [blame]
Tanya Lattner003eae52008-03-10 07:21:50 +00001; RUN: llvm-as < %s -f -o %t.bc
Dan Gohmanf17a25c2007-07-18 16:29:46 +00002; RUN: lli %t.bc > /dev/null
3
Tanya Lattner003eae52008-03-10 07:21:50 +00004declare void @exit(i32)
Dan Gohmanf17a25c2007-07-18 16:29:46 +00005
Tanya Lattner003eae52008-03-10 07:21:50 +00006define i32 @test(i8 %C, i16 %S) {
7 %X = trunc i16 %S to i8 ; <i8> [#uses=1]
8 %Y = zext i8 %X to i32 ; <i32> [#uses=1]
9 ret i32 %Y
Dan Gohmanf17a25c2007-07-18 16:29:46 +000010}
11
Tanya Lattner003eae52008-03-10 07:21:50 +000012define void @FP(void (i32)* %F) {
13 %X = call i32 @test( i8 123, i16 1024 ) ; <i32> [#uses=1]
14 call void %F( i32 %X )
Dan Gohmanf17a25c2007-07-18 16:29:46 +000015 ret void
16}
17
Tanya Lattner003eae52008-03-10 07:21:50 +000018define i32 @main() {
19 call void @FP( void (i32)* @exit )
20 ret i32 1
Dan Gohmanf17a25c2007-07-18 16:29:46 +000021}
Tanya Lattner003eae52008-03-10 07:21:50 +000022