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

int a, b, c;

void
bar ()
{
  switch (a)
  {
    case 3: __builtin_puts("a"); break;
    case 42: __builtin_puts("e"); break;
    [[likely]] case 333: __builtin_puts("i"); break;
  } 
}

/* { dg-final { scan-tree-dump "default.*3.33%.*case 3.*3.33%.*case 42.*3.33%.*case 333.*90.00%" "profile_estimate"} } */