aboutsummaryrefslogtreecommitdiff
path: root/SingleSource/Regression/C/gcc-c-torture/execute/vrp-6.c
diff options
context:
space:
mode:
Diffstat (limited to 'SingleSource/Regression/C/gcc-c-torture/execute/vrp-6.c')
-rw-r--r--SingleSource/Regression/C/gcc-c-torture/execute/vrp-6.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/SingleSource/Regression/C/gcc-c-torture/execute/vrp-6.c b/SingleSource/Regression/C/gcc-c-torture/execute/vrp-6.c
new file mode 100644
index 00000000..90de47e2
--- /dev/null
+++ b/SingleSource/Regression/C/gcc-c-torture/execute/vrp-6.c
@@ -0,0 +1,31 @@
+/* { dg-require-effective-target int32plus } */
+#include <limits.h>
+
+extern void exit (int);
+extern void abort ();
+
+void test01(unsigned int a, unsigned int b)
+{
+ if (a < 5)
+ abort();
+ if (b < 5)
+ abort();
+ if (a - b != 5)
+ abort();
+}
+
+void test02(unsigned int a, unsigned int b)
+{
+ if (a >= 12)
+ if (b > 15)
+ if (a - b < UINT_MAX - 15U)
+ abort ();
+}
+
+int main(int argc, char *argv[])
+{
+ unsigned x = 0x80000000;
+ test01(x + 5, x);
+ test02(14, 16);
+ exit (0);
+}