Testing return-by-reference semantics