This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] error on missing LTO symbols
- From: Martin Jambor <mjambor at suse dot cz>
- To: Jakub Jelinek <jakub at redhat dot com>, Tom de Vries <tdevries at suse dot de>
- Cc: Richard Biener <rguenther at suse dot de>, Jan Hubicka <jh at suse dot cz>, Thomas Schwinge <thomas at codesourcery dot com>, "gcc-patches\@gcc.gnu.org" <gcc-patches at gcc dot gnu dot org>
- Cc:
- Date: Mon, 17 Dec 2018 13:46:13 +0100
- Subject: Re: [PATCH] error on missing LTO symbols
- References: <e1cce527-a509-de3d-5cc7-3ad3a9278064@suse.de> <3b6a5c74-8a3e-d347-f07b-5407380e7429@suse.de> <20181213134425.GX12380@tucnak> <324441e7-136e-d60d-4431-e730f342f6e9@suse.de> <20181214095637.GL12380@tucnak>
Hi,
On Fri, Dec 14 2018, Jakub Jelinek wrote:
> On Fri, Dec 14, 2018 at 10:21:35AM +0100, Tom de Vries wrote:
>> --- /dev/null
>> +++ b/libgomp/testsuite/libgomp.c-c++-common/variable-not-offloaded.c
>> @@ -0,0 +1,21 @@
>> +/* { dg-do link } */
>> +/* { dg-excess-errors "lto1, mkoffload and lto-wrapper fatal errors" } */
>> +
>> +int results[2000]; /* { dg-error "variable 'results' has been referenced in offloaded code but hasn't been marked to be included in the offloaded code" } */
>> +
>> +#pragma omp declare target
>> +void __attribute__((noinline, noclone))
>> +baz (int i)
>> +{
>> + results[i]++;
>> +}
>> +#pragma omp end declare target
>> +
>> +int
>> +main ()
>> +{
>> +#pragma omp target
>> +#pragma omp for
>> + for (int i = 0; i < 2000; i++)
>> + baz (i);
>> +}
>
> Ah, one more thing, the testcase doesn't really fail when offloading isn't
> configured, so it would need some effective target or something that
> it actually does the offloading. And not really sure about shared memory
> offloading like hsail, that doesn't really need the variables declared
> either, just the functions.
>
so IIUC and IIRC, the testcase should have:
{ dg-require-effective-target offload_device_nonshared_as }
Thanks,
Martin