If you pass you put your name as the PIC and log it as P1. Then the Examiner will sign the Remarks box. I don't know what happens if you fail.
As for the IR time. All hours under the hood whilst training for a new rating(ie. Instrument Rating) are logged as dual time and also logged under the IFR box.
At least that's what I did and there was no problems. Also that's what the school I trained with told me......