tests/synthesizer: define variables where they are first used, if possible