Add test case for #3243, which was fixed as part of fix for #3511.

(Lifetime of stack allocated vectors was not being enforced)

Closes #3243.