CodeGen: Test instrumentation based profiling of templates

Make sure that templates are handled correctly by profile
instrumentation.