compiling this simple code should return 2000 but it returns 208 because it gets truncated to i8.
define i32 @"main"()
{
entry:
%"x" = alloca i32
store i32 2000, i32* %"x"
%".3" = load i32, i32* %"x"
ret i32 %".3"
}
this is how I compiled it:
llc -filetype=obj output.ll -o output.o
gcc output.o -o output -ggdb
the debugger shows the correct value to store 0x7d0, 2000 but the end result returns 208
-> 0x401110 <+0>: movl $0x7d0, -0x4(%rsp) ; imm = 0x7D0
0x401118 <+8>: movl $0x7d0, %eax ; imm = 0x7D0
0x40111d <+13>: retq
0x40111e: addb %al, (%rax)
Process 4869 exited with status = 208 (0x000000d0)
is this because I am using the terminal? or should I use stdout using llvm c printf?
Thank you in advance
compiling this simple code should return 2000 but it returns 208 because it gets truncated to i8.