gcc/libgomp/testsuite/libgomp.c++/target-same-name-2.C
Tobias Burnus 1002a7ace1 LTO: Fixes for renaming issues with offload/OpenMP [PR104285]
gcc/lto/ChangeLog:

	PR middle-end/104285
	* lto-partition.cc (maybe_rewrite_identifier): Use get_identifier
	for the returned string to be usable as hash key.
	(validize_symbol_for_target): Hence, use return value directly.
	(privatize_symbol_name_1): Track maybe_rewrite_identifier renames.
	* lto.cc (offload_handle_link_vars): Move function up before ...
	(do_whole_program_analysis): Call it after static renamings.
	(lto_main): Move call after static renamings.

libgomp/ChangeLog:

	PR middle-end/104285
	* testsuite/libgomp.c++/target-same-name-2-a.C: New test.
	* testsuite/libgomp.c++/target-same-name-2-b.C: New test.
	* testsuite/libgomp.c++/target-same-name-2.C: New test.
	* testsuite/libgomp.c-c++-common/target-same-name-1-a.c: New test.
	* testsuite/libgomp.c-c++-common/target-same-name-1-b.c: New test.
	* testsuite/libgomp.c-c++-common/target-same-name-1.c: New test.
2022-03-23 09:44:39 +01:00

25 lines
474 B
C

/* { dg-additional-sources "target-same-name-2-a.C target-same-name-2-b.C" } */
/* PR middle-end/104285 */
/* Both files create the same symbol, which caused issues
in non-host lto1. */
int test_a ();
int test_a2 ();
int test_b ();
int test_b2 ();
int
main ()
{
if (test_a () != 42)
__builtin_abort ();
if (test_a2 () != 441)
__builtin_abort ();
if (test_b () != 42)
__builtin_abort ();
if (test_b2 () != 442)
__builtin_abort ();
return 0;
}