Let E be a quasi-complete locally convex space and A a subset of E. It is shown that if every real-valued C∞-function in the weak topology of E is bounded on A, then A is relatively weakly compact. Furthermore, if all real-valued C∞-functions on E are bounded on A, then A is relatively compact in the associated semi-weak topology of E.