Function declarations are moved into common header that can be reused to avoid repetitions in different test files. Some small problems in the tests were found and fixed. Reviewed By: steakhal Differential Revision: https://reviews.llvm.org/D149158