summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/pr57656.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/torture/pr57656.c')
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr57656.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/torture/pr57656.c b/gcc/testsuite/gcc.dg/torture/pr57656.c
new file mode 100644
index 00000000000..4f3645e4693
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr57656.c
@@ -0,0 +1,13 @@
+/* { dg-do run } */
+/* { dg-options "-fstrict-overflow" } */
+
+int main (void)
+{
+ int a = -1;
+ int b = __INT_MAX__;
+ int c = 2;
+ int t = 1 - ((a - b) / c); // t = 1 - ( __INT_MIN__ / 2 )
+ if (t != (1 - (-1 - __INT_MAX__) / 2))
+ __builtin_abort();
+ return 0;
+}