Pancharatnam's geometric phase is associated with the phase of a complex-valued weak value arising in a certain type of weak measurement in pre- and post-selected quantum ensembles. This makes it possible to test the nontransitive nature of the relative phase in quantum mechanics, in the weak measurement scenario.