The car will alert the driver than something is wrong and should stop as soon as it is safe.
Because stopping engine abruptly in middle of highway could be very dangerous.
A lot of cars also have so-called "limp mode" where some failures cause car to limit engine power and other stuff, basically to get to the next point the car can be stopped and towed to shop