Added testcase to check exception handling
Inspired by a problem in the exception handling on FreeBSD I added this testcase