The M4DP is the demonstration prototype of the E-ELT adaptive mirror M4. The opticalcalibration and test of the M4DP, held in INAF laboratories during February and March 2015, has beena lesson learned for the forthcoming optical verification of the 5000 actuators, 6 segments final unit.The test procedure was tailored to fit the peculiarities of such 2 segments, 222 actuators prototype. Keyelements are the simultaneous segments control and the measurement and correction of the rigid modesover the segmented pupil; convection noise aecting the phasing was also investigated. In this paper wewill report the results of the optical test and the specific solutions implemented for the phasing controland performance verification.