add cpp loop test code