Tanya Lattner | ceca194 | 2008-03-10 07:21:50 +0000 | [diff] [blame^] | 1 | ; RUN: llvm-as < %s -f -o %t.bc |
Tanya Lattner | e9789ef | 2004-11-06 23:32:43 +0000 | [diff] [blame] | 2 | ; RUN: lli %t.bc > /dev/null |
3 | |||||
Tanya Lattner | ceca194 | 2008-03-10 07:21:50 +0000 | [diff] [blame^] | 4 | declare void @exit(i32) |
Chris Lattner | ac676be | 2002-12-03 20:30:03 +0000 | [diff] [blame] | 5 | |
Tanya Lattner | ceca194 | 2008-03-10 07:21:50 +0000 | [diff] [blame^] | 6 | define 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 | ||||
Chris Lattner | 6cc36d4 | 2002-12-28 20:01:07 +0000 | [diff] [blame] | 10 | } |
Chris Lattner | e4adeb4 | 2002-12-13 14:15:20 +0000 | [diff] [blame] | 11 | |
Tanya Lattner | ceca194 | 2008-03-10 07:21:50 +0000 | [diff] [blame^] | 12 | define void @FP(void (i32)* %F) { |
13 | %X = call i32 @test( i8 123, i16 1024 ) ; <i32> [#uses=1] | ||||
14 | call void %F( i32 %X ) | ||||
Chris Lattner | e4adeb4 | 2002-12-13 14:15:20 +0000 | [diff] [blame] | 15 | ret void |
16 | } | ||||
17 | |||||
Tanya Lattner | ceca194 | 2008-03-10 07:21:50 +0000 | [diff] [blame^] | 18 | define i32 @main() { |
19 | call void @FP( void (i32)* @exit ) | ||||
20 | ret i32 1 | ||||
Chris Lattner | ac676be | 2002-12-03 20:30:03 +0000 | [diff] [blame] | 21 | } |
Tanya Lattner | ceca194 | 2008-03-10 07:21:50 +0000 | [diff] [blame^] | 22 |