Even the latest version of GCC does the same.
Every version of Clang from 9 to head generates some variation on:
test1(unsigned int):
push {r4, r5, r7, lr}
add r7, sp, #8
mov r4, r0
movs r5, #10
mov r1, r5
bl __aeabi_uidiv
muls r5, r0, r5
subs r1, r4, r5
adds r0, r1, r0
pop {r4, r5, r7, pc}