Documentation states that on ^D on Linux(I checked on MacOS) the llvm module should dump all generated IR code. It seems that somehow the code is flushed off before being printed, the only output is something like:
; ModuleID = 'global_module'
source_filename = "global_module"
The workaround was to implement a more deterministic program exit control using a predefined input token, e.g. exit.