Add tests for the IR of some constructs.

The tests are easy to write (just dump the IR) but easy to break :-)