view gcc/testsuite/c-c++-common/unroll-5.c @ 19:2b5abeee2509 default tip

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents 84e7813d76e9
children
line wrap: on
line source

/* { 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" } */
  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" } */
  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" } */
                        /* { dg-error "cannot appear in a constant-expression|is not usable in a constant expression" "" { target c++ } .-1 } */
  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" } */
  for (unsigned long i = 1; i <= 8; ++i)
    bar(i);
}