A new code, MISHKA-F Flow, has been developed as an extension of the ideal magnetohydrodynamic MHD code MISHKA-1 [Mikhailovskii and et al. , Plasma Phys. Rep. 23 , 844 (1997)] in order to investigate the linear MHD stability of ideal and resistive eigenmodes with respect to the effects of toroidal rotation in tokamaks in general toroidal geometry with the ion diamagnetic drift effect taken into account. Benchmark test results of the MISHKA-F code show good agreement with analytic theory [A. B. Mikhailovskii and S. E. Sharapov, Plasma Phys. Controlled Fusion 42 , 57 (2000)] for the stability limits of the ideal n / m =1/1 internal kink mode.