view gcc/testsuite/gcc.dg/cold-1.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
line wrap: on
line source

/* { 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 ();
}