aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/pr119535.c
blob: fd88cc44d694533a27cccabcaf4653f9aca140d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/* PR gcov-profile/119535
/* { dg-do compile { target musttail } } */
/* { dg-options "-fprofile-generate -O2" } */
/* { dg-require-profiling "-fprofile-generate" } */

[[gnu::noipa]] int
foo (int x)
{
  return 42 + x;
}

int
bar (int x)
{
  foo (x);
  foo (2);
  [[clang::musttail]] return foo (3);
}

int
baz (int x)
{
  if (x == 42)
    return -1;
  else if (x == 15)
    return 25;
  else if (x == 26)
    [[clang::musttail]] return foo (4);
  else
    [[clang::musttail]] return foo (5);
}