Revision history   OpenPOWER Library

 2.2. GCC Compatibility Test Suite Required Tests

To test interoperability of binary code generated by a compiler under test with binary code generated by the reference compiler, create a configuration file that specifies the path names to invoke the compiler under test:

ALT_CC_UNDER_TEST

C compiler under test.

ALT_CXX_UNDER_TEST

C++ compiler under test.

The test suite will assume the compiler under test supports all GCC extensions. If this is not the case for your compiler, you can additionally specify in the configuration file a list of extensions to be skipped during test:

COMPAT_SKIPS

Tcl list of GCC extensions to be skipped.

A typical set of GCC extensions that may need to be excluded can be:

ATTRIBUTE

The GCC __attribute__ extension.

VLA_IN_STRUCT

The GCC variable-length array in struct extension.

DECIMAL_FLOAT

The GCC decimal floating-point type extension.

Creating the configuration file can be achieved by executing the following commands:

    make -C gcc site.exp
    echo 'set ALT_CC_UNDER_TEST <C compiler under test>' >>gcc/site.exp
    echo 'set ALT_CXX_UNDER_TEST <C++ compiler under test>' >>gcc/site.exp
    echo 'set COMPAT_SKIPS "[list {ATTRIBUTE} {VLA_IN_STRUCT}
                                 {DECIMAL_FLOAT}]" >>gcc/site.exp
    

in the directory where the reference compiler was built (see above).

Once the configuration file is set up, execute at least the following test cases provided by the GCC test suite:

compat.exp

Generic ABI compatibility tests.

struct-layout-1.exp

Structure layout compatibility tests.

This can be achieved by executing the following command:

    make check-gcc RUNTESTFLAGS="compat.exp struct-layout-1.exp"
    

in the same directory.