Differential Revision: https://reviews.llvm.org/D27824
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292216
91177308-0d34-0410-b5e6-
96231b3b80d8
std::vector<GenericValue> args;
Function *brainf_func = M.getFunction("brainf");
GenericValue gv = ee->runFunction(brainf_func, args);
+ // Genereated code calls putchar, and output is not guaranteed without fflush.
+ // The better place for fflush(stdout) call would be the generated code, but it
+ // is unmanageable because stdout linkage name depends on stdlib implementation.
+ fflush(stdout);
} else {
WriteBitcodeToFile(Mod.get(), *out);
}