Code coverage for assembler source files

With HCL OneTest Embedded for Eclipse IDE, you can collect coverage metrics for assembler source files. Coverage information is displayed in the coverage report.


This feature supports only ARM in 32 bits mode. It is an extension of the C language mode.

You must have configured HCL OneTest Embedded for Eclipse IDE to recognize the .asm file extension used for assembler files.

Coverage Assembler language for ARM processor is fully compatible with C/C++ and Ada code coverage.

Assembler source files are taken into account in the build as C/C++ source files. Optionally, C/C++ source files could be instrumented at the assembler level instead of at the C/C++ level.

The supported coverage levels are:
  • Functions
  • Functions and exits
  • Statement blocks
  • Calls


Code coverage for assembler source files requires the use of an appropriate TDP. You can use the clinCrossRaspiRemote.xdp and cwinCrossRaspiRemote.xdp that are delivered, for example.

There two use case scenarios:
  • For a project that uses both C and assembler source files, you only have to add the assembler .asm source files to the list of sources to be compiled. The .asm files are then instrumented, built, and linked with the other C sources to produce an executable file.
  • For C code source files that are instrumented in assembler mode, the C source files are converted into assembler files by using the gcc -S command. Then, they are instrumented in assembler mode, they are converted into assembly language, and linked.

    To implement this use case scenario, you must set the INSTR_C_AS_ASM=1 environment variable.

    To add this environment variable in Studio, proceed as follows:
    • Right-click on your project in the Project Explorer, and select Properties.
    • Select C/C++ Build > Environment.
    • Click Add, give a name to the variable, and enter INSTR_C_AS_ASM=1 in Value.
    • Apply and close the window.
    See the following example:

Note: In some case, when the assembler code increased due to the code coverage level, it might be necessary to re-organize the assembler code (Example: you can move data pools), or to decrease the level of code coverage (Example: you can delete code coverage for some functions calls in libraries).