Embedded systems are often used in safety-critical environments. Thus, thorough testing of them is mandatory. A quite active research area is the automatic test-case generation for testing embedded systems. To achieve high retargetability of the testing framework, the test-case generation has to be done at source-code level. However, it is challenging to guarantee that the test-cases obtained from the source code are also valid at the object-code level, since even in safety-critical domains programs are optimized during compilation, i.e., the compiler may also introduce new control-flow decisions to the program. In this paper we address the issue of how to guarantee the preservation of structural code coverage of test data during the optimizing compilation of the program. We analyze the formal program properties that have to be maintained to preserve different structural testing coverages, like branch coverage or modified condition/decision coverage. Based on this we describe a compil...