blob: e73157d917c87a8361bfbaa4e6525b439c13f24d [file] [log] [blame]
Tanya Lattnere9789ef2004-11-06 23:32:43 +00001; RUN: llvm-as -f %s -o %t.bc
2; RUN: lli %t.bc > /dev/null
3
Chris Lattnerac676be2002-12-03 20:30:03 +00004
Chris Lattner9f1bd802002-12-04 17:15:07 +00005declare void %exit(int)
Chris Lattnerac676be2002-12-03 20:30:03 +00006
Chris Lattner6cc36d42002-12-28 20:01:07 +00007int %test(sbyte %C, short %S) {
Chris Lattner0baf6562004-11-22 19:50:41 +00008 %X = cast short %S to ubyte
9 %Y = cast ubyte %X to int
10 ret int %Y
Chris Lattner6cc36d42002-12-28 20:01:07 +000011}
Chris Lattnere4adeb42002-12-13 14:15:20 +000012
13void %FP(void(int) * %F) {
Chris Lattner6cc36d42002-12-28 20:01:07 +000014 %X = call int %test(sbyte 123, short 1024)
15 call void %F(int %X)
Chris Lattnere4adeb42002-12-13 14:15:20 +000016 ret void
17}
18
Misha Brukman339ff0a2002-12-13 04:43:32 +000019int %main() {
Chris Lattnere4adeb42002-12-13 14:15:20 +000020 call void %FP(void(int)* %exit)
Misha Brukman339ff0a2002-12-13 04:43:32 +000021 ret int 1
Chris Lattnerac676be2002-12-03 20:30:03 +000022}