summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/predict-2.C
blob: 1e0ac1d2c48e3dfe5b9db41f175fc8f3975e0989 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-profile_estimate -std=c++11" } */

int a, b, c;

void
bar()
{
  if (a == 123)
    [[likely]] c = 5;
  else
    c = 5;
}

/* { dg-final { scan-tree-dump "first match heuristics: 90.00%" "profile_estimate"} } */
/* { dg-final { scan-tree-dump "hot label heuristics of edge .*->.*: 90.00%" "profile_estimate"} } */