In California, you can smog a car with a swapped engine as long as the engine originated in the same year as the car or newer.
For instance, you could put a 2ZR-FE into an '08 Corolla and it would be legal.
Puttling a 1ZZ-FE into an '09 Corolla would be illegal.