[LICM] Add more tests for promotion and capture (NFC)

We could optimize the first case, as the pointer is captured only
after the loop.

GitOrigin-RevId: ae2da68da62653eddc72084990ef75d39287cefd
1 file changed