Weyl's law and the Langlands program