Add some tests for shr-and folding