Add sanity check to ensure disabling optimisation changes output