Viral gain-of-function experiments uncover residues under diversifying selection in nature