brintos

brintos / llvm-project-archived public Read only

0
0
Text · 935 B · 9a6c73e Raw
31 lines · plain
1; RUN: llvm-as %s -o - | llvm-dis > %t1.ll2; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll3; RUN: diff %t1.ll %t2.ll4; RUN: llvm-as < %s | lli -jit-kind=mcjit --force-interpreter=true | FileCheck %s5; CHECK: -2556 7@ARRAY   = global [ 20 x i17 ] zeroinitializer8@FORMAT  = constant [ 4 x i8 ] c"%d\0A\00"9 10declare i32 @printf(i8* %format, ...)11 12define void @multiply(i32 %index, i32 %X, i32 %Y) {13  %Z = mul i32 %X, %Y14  %P = getelementptr [20 x i17], [20 x i17]* @ARRAY, i32 0, i32 %index15  %Result = trunc i32 %Z to i1716  store i17 %Result, i17* %P17  ret void18}19 20define i32 @main(i32 %argc, i8** %argv) {21  %i = bitcast i32 0 to i3222  call void @multiply(i32 %i, i32 -1, i32 255) 23  %P = getelementptr [20 x i17], [20 x i17]* @ARRAY, i32 0, i32 024  %X = load i17, i17* %P25  %result = sext i17 %X to i3226  %fmt = getelementptr [4 x i8], [4 x i8]* @FORMAT, i32 0, i32 027  call i32 (i8*,...) @printf(i8* %fmt, i32 %result)28  ret i32 029}30 31