URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [README.compat] - Rev 701
Go to most recent revision | Compare with Previous | Blame | View Log
Compatibility test suites that use lib/compat.exp test interoperabilityof two compilers that follow the same ABI, or of multiple sets ofcompiler options that are not intended to affect binary compatibility.They do not test conformance to a formal ABI; they check that things aredone consistently, not that they are done correctly. They are meant tocomplement ABI test suites, not to replace them.Each test in these suites splits up functionality into two source filesthat can be compiled with two different versions of GCC and with twosets of compiler options.Override the default pairs of compiler options (from compat.exp) bydefining the environment variable COMPAT_OPTIONS as:COMPAT_OPTIONS="[list [list {tst1} {alt1}]...[list {tstn} {altn}]]"where tsti and alti are lists of options, with "tsti" used by thecompiler under test and "alti" used by the alternate compiler. Thecharacters "[", "{", "}", and "]" are really in the string, as in"[list [list {-g} {-O3}] [list {-O3} {-g}]]".To use an alternate compiler, define the environment variable for thelanguage you're testing; e.g., for C++ define ALT_CXX_UNDER_TEST to bethe full pathname of an installed compiler. That will be written tothe site.exp file used by DejaGNU. The default is to build each testwith the compiler under test using the first of each pair of compileroptions from COMPAT_OPTIONS. When ALT_CXX_UNDER_TEST is "same", eachtest is built using the compiler under test but with combinations ofthe options from COMPAT_OPTIONS. If the alternate compiler needs adifferent setting for LD_LIBRARY_PATH, specify it in the environmentvarible ALT_LD_LIBRARY_PATH. If it needs different options to builda shared object, define those in ALT_SHOBJ_OPTIONS.Normally, only a small amount of compatibility tests is run.Setting RUN_ALL_COMPAT_TESTS=1 in the environment before running thetestsuite enables running all compatibility tests, but might takesignificantly longer than it takes without this variable.To run only the C++ compatibility tests, optionally specifying analternate compiler and/or sets of options, do from $objdir/gcc:rm site.expmake -k ALT_CXX_UNDER_TEST=<prefix>/bin/g++ \ALT_LD_LIBRARY_PATH=<prefix>/lib \COMPAT_OPTIONS="list as shown above" check-c++ \RUNTESTFLAGS="compat.exp"A test that fails when the pieces are compiled with different compilersbut passes when the pieces are compiled with the same compilerdemonstrates incompatibility of the generated code or runtime support.A test that fails for the alternate compiler but passes for the compilerunder test probably tests for a fix that is not present in the alternatecompiler.There's a lot more that can be done with these tests.Increase the robustness of the existing tests:- recognize target triples in dg-options strings in test files- continue to split up tests that rely on language runtime supportand add them to this set of tests- make sure they work for testing with a simulator- multilibs support?Build test pieces into more combinations that will be likely to findunusual errors:- link using the alternate compiler; this requires support forLD_LIBRARY_PATH for the alternate compiler in the support for eachlanguage- build pieces of the test into static libraries; this requiresknowledge about how to build a static library for each targetContinue to add tests to g++.dg/compat, based on existing tests forlanguage runtime support and for test cases in PRs that didn't used tofit into the test suite.Set up similar tests in libstdc++-v3/testsuite.Set up similar tests for additional languages and libraries.Janis Johnson, <janis187@us.ibm.com>October 2002Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.Copying and distribution of this file, with or without modification,are permitted in any medium without royalty provided the copyrightnotice and this notice are preserved.
Go to most recent revision | Compare with Previous | Blame | View Log
