When I type-check, I think I need to check "return type of current function" and "type of value which will be returned".
However, when I use below function and compile it, compiler add type-casting in .ll file automatically.
int f(int x) {
char a = 0;
return a;
}
Therefore, I modify .ll file manually but parser throws below exception.
Fatal error: exception Dummy_llvm_irreader.Error("test/example1.ll:15:7: error: value doesn't match function result type 'i32'\n ret i8 %0\n ^\n")
Because parser throws exception for this case, we don't need to consider such case?