We analyse an hp FEM for convection-diffusion problems. Stability is achieved by suitably upwinded test functions, generalizing the classical α-quadratically upwinded and the Hemker test-functions for piecewise linear trial spaces (see, e.g., Morton 1995 Numerical Solutions of Convection-Diffusion Problems, Oxford: Oxford University Press, and the references therein). The method is proved to be stable independently of the viscosity. Further, the stability is shown to depend only weakly on the spectral order. We show how suf"ciently accurate, approximate upwinded test functions can be computed on each element by a local least-squares FEM. Under the assumption of analyticity of the input data, we prove robust exponential convergence of the method. Numerical experiments con"rm our convergence estimates and show robust exponential convergence of the hp FEM even for viscosities of the order of the machine precision, i.e., for the limiting transport problem.