aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/predcom-8.c
blob: dcddf57314580c061792dc91bf0f0edb915bdf33 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
/* { dg-do compile } */
/* { dg-options "-O3 -fdump-tree-pcom-details-blocks" } */

int is_sorted(int *a, int n)
{
  for (int i = 0; i < n - 1; i++)
    if (a[i] > a[i + 1])
      return 0;
  return 1;
}

/* { dg-final { scan-tree-dump "Executing predictive commoning without unrolling" "pcom" } } */
/* { dg-final { scan-tree-dump-not "Invalid sum" "pcom" } } */