Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/gcc.dg/pr80776-1.c @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
111:04ced10e8804 | 131:84e7813d76e9 |
---|---|
1 /* { dg-do compile } */ | |
2 /* { dg-options "-O2 -Wformat-overflow" } */ | |
3 | |
4 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) int | |
5 __attribute__ ((__nothrow__ , __leaf__)) sprintf (char *__restrict __s, const char *__restrict __fmt, ...) | |
6 { | |
7 return __builtin___sprintf_chk (__s, 2 - 1, | |
8 __builtin_object_size (__s, 2 > 1), __fmt, __builtin_va_arg_pack ()); | |
9 } | |
10 char number[sizeof "999999"]; | |
11 int somerandom (void); | |
12 void | |
13 Foo (void) | |
14 { | |
15 int i = somerandom (); | |
16 if (! (0 <= i)) | |
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 *-*-* } } */ | |
23 } |