blob: f87e061d87bb4a9282e350ca0877f795722e8779 [file] [log] [blame]
Reid Spencer5f1397d2007-01-03 23:54:02 +00001; RUN: llvm-as < %s | llvm-dis > %t1.ll
2; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
3; RUN: diff %t1.ll %t2.ll
4
Reid Spencer13701fa2007-01-04 00:03:37 +00005%ZFunTy = type i32(i8 @zext)
6%SFunTy = type i32(i8 @sext)
Reid Spencer5f1397d2007-01-03 23:54:02 +00007
Reid Spencer13701fa2007-01-04 00:03:37 +00008declare i16 @(sext) "test"(i16 @sext %arg)
9declare i8 @zext "test2" (i16 @zext %a2)
Reid Spencer5f1397d2007-01-03 23:54:02 +000010
11implementation
12
13define i32 %main(i32 %argc, i8 **%argv) {
14 %val = trunc i32 %argc to i16
15 %res = call i16 @sext (i16 @sext) *%test(i16 %val)
16 %two = add i16 %res, %res
Reid Spencer13701fa2007-01-04 00:03:37 +000017 %res = call i8 @zext %test2(i16 %two @zext)
Reid Spencer5f1397d2007-01-03 23:54:02 +000018 %retVal = sext i16 %two to i32
19 ret i32 %retVal
20}