This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] error on missing LTO symbols


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.

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]