Codegen tests for captured statements with templates

Differential-revision: llvm-reviews.chandlerc.com/D778