summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/cold-1.c
blob: ba1cd3a4e62ad4ccb591c3235e1303f947dbcd63 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* { dg-do compile { target nonpic } } */
/* { dg-options "-O2 -Wsuggest-attribute=cold" } */

extern void abort (void);
extern void do_something_interesting_and_never_return ();

int
foo1(int a)  
{ /* { dg-warning "cold" "detect cold candidate" { target *-*-* } ".-1" } */
  if (a)
    abort ();
  else
    abort ();
}

int
foo2(int a)  
{ 
  if (a)
    do_something_interesting_and_never_return ();
  abort ();
}