Note: the "SingleSource/Benchmarks/Polybench/stencils/adi" subtest varies not only across {-Ofast vs. -O2 or -O3 both withOUT -ffast-math} but also across {AMD64 vs. AArch64}.
Tested to pass on both AArch64 and AMD64 with both "-O3" and "-O3 -ffp-contract=fast", on top of:
commit d471bba591ad51ecf4180cebda63e486d2fa877c Author: Sunil Srivastava <sunil_srivastava@playstation.sony.com> Date: Mon Oct 17 04:32:15 2016 +0000
[Abe is intentionally leaving the Polybench stuff for Sebastian since he has already started fixing it]
[Abe is intentionally leaving the "-Ofast"-compatibility work for a different patch, at MB`s request.]
I would rename the final variable to something like "TEST_SUITE_USES_FAST_MATH" (so the name is also correct in the case of the variable being set by the user instead of automatically detected). From that point you should be able to handle it in a similar fashion as TEST_SUITE_BENCHMARKING_ONLY.