Commit Graph

15 Commits

Author SHA1 Message Date
Jakub Jelinek
254a858ae7 Update copyright years. 2026-01-02 09:56:11 +01:00
Matthew Fortune
dc1d1a30fa [PATCH v2 1/1] Ensure _UNDER_TEST executables are target based
This fixes an issue where some G++ tests need to use a C compiler as
well as C++ to build an LTO test.

contrib/
	* test_installed: Use target to select default gcc/g++ etc.
	under test.

Signed-off-by: Matthew Fortune <matthew.fortune@imgtec.com>
Signed-off-by: Faraz Shahbazker <fshahbazker@wavecomp.com>
Signed-off-by: Aleksandar Rakic <aleksandar.rakic@htecgroup.com>
2025-12-26 16:54:48 -07:00
Joseph Myers
edf5b880b8 testsuite: Support plugin testing for installed compiler
Plugin tests are currently only enabled for build-tree testing.
Enable them for installed testing as well, using
-print-file-name=plugin/include to locate the installed headers in
that case.

Support is also added to contrib/test_installed for the associated
site.exp settings.  Installed testing also shows up that some plugin
tests are using text-art/*.h headers that aren't currently installed,
so add those to PLUGIN_HEADERS.

Bootstrapped with no regressions for x86_64-pc-linux-gnu, and also ran
plugin tests for an installed compiler with contrib/test_installed.

contrib/
	* test_installed (--enable-plugin, --with-plugincc=)
	(--with-plugincflags=, --with-gmpinc=): New options.

gcc/
	* Makefile.in (PLUGIN_HEADERS): Add $(srcdir)/text-art/*.h.
	(install-plugin): Preserve directory structure for text-art
	headers.

gcc/testsuite/
	* lib/plugin-support.exp (plugin-test-execute): Support installed
	testing.
	* g++.dg/plugin/plugin.exp, gcc.dg/plugin/plugin.exp,
	obj-c++.dg/plugin/plugin.exp, objc.dg/plugin/plugin.exp: Do not
	disable for installed testing.
2025-12-15 17:58:20 +00:00
Joseph Myers
311d2829db contrib: Use config.sub in test_installed
Correctly running GCC testsuites with an installed compiler requires
both the canonical and noncanonical versions of the target triplet:
the canonical one for where the testsuite matches on target triplets,
and the noncanonical one for various "transform" calls used to find
binutils programs.  Make test_installed use config.sub to determine
the canonical target from any value passed with --target= (and thus
make logic to locate the toplevel source directory from its own
location unconditional, as it's now used to locate config.sub).

	* test_installed: Use config.sub to determine canonical target.
2025-12-11 23:20:54 +00:00
Joseph Myers
a7b8c5faa6 contrib: Set more site.exp variables in test_installed
Add support in contrib/test_installed for more variables (via
associated command-line options to the script) that gcc/Makefile.in
can set:

* ALT_CC_UNDER_TEST, ALT_CXX_UNDER_TEST and COMPAT_OPTIONS are used in
  compat testing (against the same or a different compiler).

* The libiconv variable is used for testing iconv support for
  particular character sets, and defaults to -liconv if not set in
  site.exp, which is wrong on systems with iconv in libc; keep the
  default, but add an option to override this.

  Note that the dg-require-iconv testing is currently bogus in a cross
  environment, and this patch does nothing to address that.  The tests
  using dg-require-iconv actually care about character set support on
  the *host*, for character conversions carried out in the compiler,
  and the libiconv setting put in site.exp by gcc/Makefile.in is a
  *host* library setting.  But dg-require-iconv /
  check_iconv_available tests availability when compiling, linking and
  executing for the *target*.  If the host and target have close
  enough to the same OS, this may work by accident, but otherwise it
  will incorrectly enable / disable these tests based on target
  information (but using a libiconv setting designed for the host)
  when it should be based on host information.

	* test_installed (--with-alt-cc=, --with-alt-cxx=)
	(--with-compat-options=, --with-libiconv=): New options.
2025-12-08 17:02:22 +00:00
Jakub Jelinek
6441eb6dc0 Update copyright years. 2025-01-02 11:59:57 +01:00
Jakub Jelinek
62babed519 contrib: Fill in HOST{CC,CFLAGS,CXX,CXXFLAGS} in test_installed
gcc/Makefile.in since my r0-60234 change fills in HOSTCC and HOSTCFLAGS
in site.exp and since r8-671 also HOSTCXX and HOSTCXXFLAGS.
If those variables aren't set, we get errors like:
/usr/src/gcc/contrib/test_installed --without-g++ --without-gfortran --without-objc struct-layout-1.exp
...
ERROR: tcl error sourcing /usr/src/gcc/gcc/testsuite/gcc.dg/compat/struct-layout-1.exp.
ERROR: tcl error code TCL LOOKUP VARNAME HOSTCC
ERROR: can't read "HOSTCC": no such variable
    while executing
"remote_exec build "$HOSTCC $HOSTCFLAGS $generator_cmd""
    (file "/usr/src/gcc/gcc/testsuite/gcc.dg/compat/struct-layout-1.exp" line 96)
    invoked from within
"source /usr/src/gcc/gcc/testsuite/gcc.dg/compat/struct-layout-1.exp"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0 source /usr/src/gcc/gcc/testsuite/gcc.dg/compat/struct-layout-1.exp"
    invoked from within
"catch "uplevel #0 source $test_file_name" msg"

(similarly in g++ or gfortran) struct-layout-1.exp.  One doesn't need to
test specially for just struct-layout-1.exp alone, just not using any arg
will trigger it as well, just later.

The following patch fills it in as cc and c++ with empty flags to compile
those, I believe that is what e.g. make uses by default, so it should be a
reasonable default.  We IMHO shouldn't default to GCC_UNDER_TEST because
that might be a cross-compiler etc.

2024-02-05  Jakub Jelinek  <jakub@redhat.com>

	* test_installed: Fill in HOSTCC, HOSTCXX, HOSTCFLAGS and
	HOSTCXXFLAGS.
2024-02-05 18:57:45 +01:00
Jakub Jelinek
a945c346f5 Update copyright years. 2024-01-03 12:19:35 +01:00
Jakub Jelinek
83ffe9cde7 Update copyright years. 2023-01-16 11:52:17 +01:00
Steve Ellcey
1a607203b2 test_installed (--target=): New option.
2015-06-02  Steve Ellcey  <sellcey@imgtec.com>

	* test_installed (--target=): New option.

From-SVN: r224034
2015-06-02 17:12:16 +00:00
Dominique d'Humieres
7276d36825 * test_installed: Adjust to the move from g77 to gfortran.
From-SVN: r122340
2007-02-26 20:40:13 +00:00
Matthias Klose
c3c3593270 test_installed: Add options to run objc tests.
2003-07-11  Matthias Klose  <doko@debian.org>

        * test_installed: Add options to run objc tests.
        In generated site.exp, initialize rootme, CFLAGS, CXXFLAGS.

From-SVN: r69219
2003-07-11 06:05:01 +00:00
Rainer Orth
1e6347d8b9 Makefile.in: Allow for PWDCMD to override hardcoded pwd.
* Makefile.in: Allow for PWDCMD to override hardcoded pwd.
	* config-ml.in: Likewise.
	* configure: Likewise.
	* configure.in: Likewise.

	boehm-gc:
	* acinclude.m4: Allow for PWDCMD to override hardcoded pwd.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

	config:
	* acinclude.m4: Allow for PWDCMD to override hardcoded pwd.

	contrib:
	* test_installed: Allow for PWDCMD to override hardcoded pwd.
	* test_summary: Likewise.

	gcc:
	* Makefile.in: Allow for PWDCMD to override hardcoded pwd.
	* configure.in: Likewise.
	* fixinc/check.tpl: Likewise.
	* fixinc/fixinc.dgux: Likewise.
	* fixinc/fixinc.svr4: Likewise.
	* fixinc/fixinc.winnt: Likewise.
	* fixinc/fixincl.sh: Likewise.
	* fixproto: Likewise.
	* configure: Regenerate.

	gcc/ada:
	* Makefile.adalib: Allow for PWDCMD to override hardcoded pwd.
	* Makefile.in: Likewise.

	gcc/f:
	* Make-lang.in: Allow for PWDCMD to override hardcoded pwd.

	gcc/java:
	* Make-lang.in: Allow for PWDCMD to override hardcoded pwd.

	gcc/po:
	* exgettext: Allow for PWDCMD to override hardcoded pwd.

	gcc/treelang:
	* Make-lang.in: Allow for PWDCMD to override hardcoded pwd.

	libf2c:
	* Makefile.in: Allow for PWDCMD to override hardcoded pwd.
	* aclocal.m4: Likewise.
	* configure: Regenerate.

	libjava:
	* acinclude.m4: Allow for PWDCMD to override hardcoded pwd.
	* configure.in: Likewise.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

	libobjc:
	* aclocal.m4: Allow for PWDCMD to override hardcoded pwd.
	* configure: Regenerate.

	libstdc++-v3:
	* Makefile.am: Allow for PWDCMD to override hardcoded pwd.
	* acinclude.m4: Likewise.
	* docs/html/Makefile: Likewise.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* Makefile.in: Regenerate.

	zlib:
	* configure.in: Allow for PWDCMD to override hardcoded pwd.
	* configure: Regenerate.

	* ChangeLog: Move entries to ChangeLog.gcj.

From-SVN: r53523
2002-05-16 17:43:21 +00:00
Joseph Myers
6f298a0a2d * test_installed: Change EGCS references to refer to GCC.
From-SVN: r36788
2000-10-08 19:39:27 +01:00
Alexandre Oliva
49e921be33 test_installed: new script for testing already-installed
* test_installed: new script for testing already-installed
 	gcc/g++/g77

From-SVN: r21728
1998-08-14 10:09:42 +00:00