Add test suite for printf.

Fixes #4064