US President Donald Trump left the G7 summit in Canada early, warning people in Tehran they should evacuate immediately.