On 07/24/2017 08:56 PM, Jan Hubicka wrote:
* gcc.dg/cold-1.c: New testcase.
Index: testsuite/gcc.dg/cold-1.c =================================================================== --- testsuite/gcc.dg/cold-1.c (revision 0) +++ testsuite/gcc.dg/cold-1.c (working copy) @@ -0,0 +1,21 @@ +/* { dg-do compile { target nonpic } } */ +/* { dg-options "-O2 -Wsuggest-attribute=cold" } */ + +extern void do_something_interesting_and_never_return (); + +int +foo1(int a) +{ /* { dg-warning "cold" "detect cold candidate" { target *-*-* } "8" } */ + if (a) + abort (); + else + abort (); +} + +int +foo2(int a) +{ + if (a) + do_something_interesting_and_never_return (); + abort (); +}
Hi, this test-case failed for me due to: - excess errors due to missing abort declaration - warning emitted on line 7, but is expected on line 8 This patch that: - fixes the warning line number - rewrites the absolute warning line number into a relative one - adds the abort declaration Committed as obvious. Thanks, - Tom
Fix gcc.dg/cold-1.c 2017-10-09 Tom de Vries <t...@codesourcery.com> * gcc.dg/cold-1.c (foo1): Fix warning line number. Make warning line number relative. (abort): Declare. --- gcc/testsuite/gcc.dg/cold-1.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/testsuite/gcc.dg/cold-1.c b/gcc/testsuite/gcc.dg/cold-1.c index 8ea88dd..ba1cd3a 100644 --- a/gcc/testsuite/gcc.dg/cold-1.c +++ b/gcc/testsuite/gcc.dg/cold-1.c @@ -1,11 +1,12 @@ /* { 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 *-*-* } "8" } */ +{ /* { dg-warning "cold" "detect cold candidate" { target *-*-* } ".-1" } */ if (a) abort (); else