Add test suite for #8602

Signed-off-by: Austin Seipp <austin@well-typed.com>
Tests for #8601

Signed-off-by: Austin Seipp <austin@well-typed.com>