A car with a cracked windshield may pass inspection. However, this depends on the state where the car is inspected and the severity and location of the crack in the windshield.
For example, according to the Virginia State Police, a car fails inspection if the crack is located above the 3-inch line at the bottom of the windshield and is bigger than 1.5 inches in diameter or if there are multiple cracks that extend at least 1.5 inches from the same point. A car also fails if the crack weakens the windshield so badly that a piece moves.
The New Jersey Motor Vehicle Commission indicates that a cracked windshield no longer automatically means the car fails its inspection, but New Jersey law enforcement can ticket the vehicle for "failure to make necessary repairs."