1 /* PR middle-end/78622 - [7 Regression] -Wformat-overflow/-fprintf-return-value
2 incorrect with overflow/wrapping
3 { dg-skip-if "Requires %hhd format" { hppa*-*-hpux* } }
4 { dg-require-effective-target c99_runtime }
5 { dg-additional-options "-Wformat-overflow=2" } */
7 __attribute__((noinline
, noclone
)) int
10 if (x
< 4096 + 8 || x
>= 4096 + 256 + 8)
14 int n
= __builtin_snprintf (buf
, sizeof buf
, "%hhd", x
+ 1);
15 __builtin_printf ("\"%hhd\" => %i\n", x
+ 1, n
);
22 if (__SCHAR_MAX__
!= 127 || __CHAR_BIT__
!= 8 || __SIZEOF_INT__
!= 4)
25 if (foo (4095 + 9) != 1
26 || foo (4095 + 32) != 2
27 || foo (4095 + 127) != 3
28 || foo (4095 + 128) != 4
29 || foo (4095 + 240) != 3
30 || foo (4095 + 248) != 2
31 || foo (4095 + 255) != 2
32 || foo (4095 + 256) != 1)