Those interested in testing optimizers may have a look at equivalence modulo testing, a fascinating research field:
https://dl.acm.org/doi/10.1145/2666356.2594334
Fuzzing your own optimizer before shipping it is the kind of thing that sounds obvious in hindsight and almost nobody does upfront.
It would have been nice if the article explained what an optimizer is in this case?