view gcc/testsuite/gcc.dg/pr41783.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
line wrap: on
line source

/* { dg-do compile } */
/* { dg-options "-O3 -fdump-tree-pre -fno-tree-loop-im" } */
int db[100];
int a_global_var, fact;
int main()
{
  int i,j=0;
  do
    {
      for (i=0; i<100; ++i)
        db[i] = i;
      fact = a_global_var * i;
    }
  while (j++ < 100);
}
/* We want to have exactly one load (not two) from a_global_var,
   and we want that load to be into a PRE temporary.  */
/* { dg-final { scan-tree-dump-times "= a_global_var;" 1 "pre" } } */
/* { dg-final { scan-tree-dump "pretmp\[^\\n\]* = a_global_var;" "pre" } } */