diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/pr81592.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/pr81592.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr81592.c b/gcc/testsuite/gcc.dg/pr81592.c new file mode 100644 index 00000000000..a37703af497 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr81592.c @@ -0,0 +1,20 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -Wall -fno-strict-overflow -Wstrict-overflow=2 -fsanitize=signed-integer-overflow" } */ + +#include <stdio.h> + +int proc_keys_show(long expiry, long now) +{ + unsigned long timo; + char xbuf[4]; + + if (now < expiry) { + timo = expiry - now; + if (timo < 60) + sprintf(xbuf, "%lus", timo); + } + + return 0; +} + + |