Pull out well-defined sections of inline code that can be executed independently for testing? Sure, that's breaking it down into functions.
Re:John Carmack on Inlined Code (2014)
by MereInterest on Tuesday July 19, 2016 @12:30PM
(#12122686)
I think there is such a feature. In most languages, these are called "functions".
I guess this could trip up if the compiler optimisations available when considering all the code at once means that the out-of-context code actually does something different in testing...