aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr41232.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/pr41232.c')
-rw-r--r--gcc/testsuite/gcc.dg/pr41232.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr41232.c b/gcc/testsuite/gcc.dg/pr41232.c
new file mode 100644
index 00000000000..17ec54899d7
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr41232.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -g" } */
+extern int atoi (const char *);
+extern int sprintf (char *, const char *, ...);
+void malloc_init() {
+ char *cptr;
+ char buf[1];
+ int tmbd = atoi(cptr);
+ if (tmbd > 0)
+ tmbd = (tmbd <= 124) ? tmbd : 124;
+ else
+ tmbd = 0;
+ sprintf(buf, "%d\n", tmbd);
+}