1 /* { dg-do compile } */
2 /* { dg-options "-O2 -Wformat-overflow" } */
4 extern __inline
__attribute__ ((__always_inline__
)) __attribute__ ((__gnu_inline__
)) __attribute__ ((__artificial__
)) int
5 __attribute__ ((__nothrow__
, __leaf__
)) sprintf (char *__restrict __s
, const char *__restrict __fmt
, ...)
7 return __builtin___sprintf_chk (__s
, 2 - 1,
8 __builtin_object_size (__s
, 2 > 1), __fmt
, __builtin_va_arg_pack ());
10 char number
[sizeof "999999"];
11 int somerandom (void);
15 int i
= somerandom ();
17 __builtin_unreachable ();
18 if (! (0 <= i
&& i
<= 999999))
19 __builtin_unreachable ();
20 /* The correctness bits for [E]VRP cannot handle chained conditionals
21 when deciding to ignore a unreachable branch for setting SSA range info. */
22 sprintf (number
, "%d", i
); /* { dg-bogus "writing" "" { xfail *-*-* } } */