summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/Wstrict-overflow-24.c
blob: 05e8dd144844de9cab50db1b5218c1a7a795bc25 (plain)
1
2
3
4
5
6
7
8
9
10
/* { dg-do compile } */
/* { dg-options "-fstrict-overflow -O2" } */
/* { dg-message "warnings being treated as errors" "" {target "*-*-*"} 0 } */
#pragma GCC diagnostic error "-Wstrict-overflow"

int
foo (int i)
{
  return __builtin_abs (i) >= 0; /* { dg-error "assuming signed overflow does not occur" "correct warning" } */
}