aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr30364-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.dg/torture/pr30364-1.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr30364-1.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr30364-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr30364-1.c
new file mode 100644
index 000000000..64ee7e44e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr30364-1.c
@@ -0,0 +1,20 @@
+/* { dg-do run } */
+
+#include <limits.h>
+extern void abort (void);
+
+int f(int a, int b)
+{
+ if (a > INT_MAX - 15) return 0;
+ if (b > INT_MAX - 15) return 0;
+
+ int c = (a - 20) + (b - 20);
+ return c > INT_MAX - 15;
+}
+
+int main()
+{
+ if (f (INT_MAX - 15, 41) != 1)
+ abort ();
+ return 0;
+}