We consider an optimal control problem subject to a semilinear elliptic PDE together with its variational discretization. We provide a condition which allows to decide whether a solution of the necessary first order conditions is a global minimum. This condition can be explicitly evaluated at the discrete level. Furthermore, we prove that if the above condition holds uniformly with respect to the discretization parameter the sequence of discrete solutions converges to a global solution of the corresponding limit problem. Numerical examples with unique global solutions are presented.