[testsuite, committed] Use relative line number in unroll-5.c

Tom de Vries Tom_deVries@mentor.com
Wed Dec 27 07:32:00 GMT 2017


[ was: Re: [C/C++] Add support for #pragma GCC unroll v3 ]

On 11/25/2017 11:15 AM, Eric Botcazou wrote:
> Index: testsuite/c-c++-common/unroll-5.c
> ===================================================================
> --- testsuite/c-c++-common/unroll-5.c	(revision 0)
> +++ testsuite/c-c++-common/unroll-5.c	(working copy)
> @@ -0,0 +1,29 @@
> +/* { dg-do compile } */
> +
> +extern void bar (int);
> +
> +int j;
> +
> +void test (void)
> +{
> +  #pragma GCC unroll 4+4
> +  for (unsigned long i = 1; i <= 8; ++i)
> +    bar(i);
> +
> +  #pragma GCC unroll -1	/* { dg-error "requires an assignment-expression that evaluates to a non-negative integral constant less than or equal to" } */
> +  for (unsigned long i = 1; i <= 8; ++i)
> +    bar(i);
> +
> +  #pragma GCC unroll 20000000000	/* { dg-error "requires an assignment-expression that evaluates to a non-negative integral constant less than or equal to" } */
> +  for (unsigned long i = 1; i <= 8; ++i)
> +    bar(i);
> +
> +  #pragma GCC unroll j	/* { dg-error "requires an assignment-expression that evaluates to a non-negative integral constant less than or equal to" } */
> +                        /* { dg-error "cannot appear in a constant-expression|is not usable in a constant expression" "" { target c++ } 21 } */
> +  for (unsigned long i = 1; i <= 8; ++i)
> +    bar(i);
> +
> +  #pragma GCC unroll  4.2	/* { dg-error "requires an assignment-expression that evaluates to a non-negative integral constant less than or equal to" } */
> +  for (unsigned long i = 1; i <= 8; ++i)
> +    bar(i);
> +}

Hi,

this patch changes the absolute line number into a relative one.

Tested on x86_64 and committed.

Thanks,
- Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Use-relative-line-number-in-unroll-5.c.patch
Type: text/x-patch
Size: 990 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20171227/6bd03711/attachment.bin>


More information about the Gcc-patches mailing list