mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-11-27 05:44:15 +08:00
1002a7ace1
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.
61 lines
956 B
C
61 lines
956 B
C
/* { dg-skip-if "" { *-*-* } } */
|
|
/* Used by target-same-name-1.c */
|
|
|
|
static int local_link = 55;
|
|
#pragma omp declare target link(local_link)
|
|
|
|
extern int decl_a_link;
|
|
#pragma omp declare target link(decl_a_link)
|
|
|
|
#pragma omp declare target
|
|
static int __attribute__ ((noinline,noclone))
|
|
foo ()
|
|
{
|
|
return 7;
|
|
}
|
|
#pragma omp end declare target
|
|
|
|
static int __attribute__ ((noinline,noclone))
|
|
bar ()
|
|
{
|
|
int i;
|
|
#pragma omp target map(from:i)
|
|
i = foo ();
|
|
return i;
|
|
}
|
|
|
|
int
|
|
two () {
|
|
return bar ();
|
|
}
|
|
|
|
int
|
|
two_get_inc4_local_link ()
|
|
{
|
|
int res, res2;
|
|
#pragma omp target map(from: res, res2)
|
|
{
|
|
res = local_link;
|
|
local_link += 4;
|
|
res2 = local_link;
|
|
}
|
|
if (res + 4 != res2)
|
|
__builtin_abort ();
|
|
return res;
|
|
}
|
|
|
|
int
|
|
two_get_inc5_link_a ()
|
|
{
|
|
int res, res2;
|
|
#pragma omp target map(from: res, res2)
|
|
{
|
|
res = decl_a_link;
|
|
decl_a_link += 5;
|
|
res2 = decl_a_link;
|
|
}
|
|
if (res + 5 != res2)
|
|
__builtin_abort ();
|
|
return res;
|
|
}
|