Test handling of simple mask reference loop