A vehicle will not fail the smog test simply because the odometer is not working. It is important however to ensure the fault causing the odometer malfunction is not affecting the vehicle's engine control computer and/or visa-versa. For example, a defective wheel speed or crankshaft position sensor might cause both the odometer and speedometer to malfunction, setting a trouble code in the computer and turning on the check engine light. The vehicle will fail due to the illuminated check engine light, caused by the defective speed sensor; and not necessarily because of the malfunctioning speedometer or odometer.
If you notice all other instrument cluster functions working properly, including and most importantly, the check engine light (or malfunction indicator lamp MIL), we can be safe in assuming your car or truck will pass the smog check with the broken odometer. The check engine light or MIL should be ON while the ignition is in the ON position, and turn OFF while the engine is running.
A good indication that the broken odometer is also affecting the emissions system is an illuminated Check Engine Light. Some late model vehicles will do this even when the only fault is a defective instrument cluster. If no check engine light is on, and the only problem is a failed odometer, you should not have a problem getting a smog test, the smog technician will enter "none" for the mileage question on the smog machine.