aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/cold-2.c
blob: 7f78496fb8205afc54baa5e3ee46cb2f2e286312 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* PR ipa/105685 */
/* { dg-do compile } */
/* { dg-options "-O2 -Wsuggest-attribute=cold" } */

extern void foo (char *, char const *, int);

__attribute__((cold)) char *
bar (int x)
{
  static char b[42];
  foo (b, "foo", x);
  return b;
}

__attribute__((cold)) char *
baz (int x)		/* { dg-bogus "function might be candidate for attribute 'cold'" } */
{
  return bar (x);
}