asm printer pass leaves empty file

I’ve used llvm::TargetMachine::addPassesToEmitFile() method to add the Assembly printing passes, but it doesn’t work, cause it leaves my file empty.

It’s weird cause object files are generated successfully with the same configuration. Changing the CGFT to AssemblyFile and the given stream in text mode, Assembly simply doesn’t get printed.

Could it be a bug I should file on bugzilla?