Calling Convention Tester
Calling Convention Tester
The calling convention of a compiler specifies how functions receive parameters from the functions that called them and how their result is returned to the calling function. This implementation can be very complex, with the goal to make the action of calling a function as efficient as possible. In the verification of a compiler, it is therefore important to test if the calling convention is implemented correctly.
For this purpose, we provide the Calling Convention Tester, which is included in the SuperTest Compiler Test Suite. The Calling Convention Tester generates pairs of source files, which are carefully constructed and self-testing. Of such a pair of files, one file contains a function that checks if the values of the parameters are the expected generated values, and the other file contains a call to this function with parameters set to the generated values and checking return values. This way, the Calling Convention Tester can be used to verify calling conventions within a compiler, verify that there are no ABI-breaking changes between different versions of a compiler or even test for calling convention consistency between completely different compilers.
The Calling Convention Tester is highly configurable in e.g. the number of tests to generate, in the used data types or in the usage of variable length argument lists (varargs). Hence, the Calling Convention Tester can be configured to exactly meet the properties of the tested compiler(s).