aboutsummaryrefslogtreecommitdiff
path: root/SingleSource/Regression/C/gcc-c-torture/execute/doloop-2.c
diff options
context:
space:
mode:
Diffstat (limited to 'SingleSource/Regression/C/gcc-c-torture/execute/doloop-2.c')
-rw-r--r--SingleSource/Regression/C/gcc-c-torture/execute/doloop-2.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/SingleSource/Regression/C/gcc-c-torture/execute/doloop-2.c b/SingleSource/Regression/C/gcc-c-torture/execute/doloop-2.c
new file mode 100644
index 00000000..f9811800
--- /dev/null
+++ b/SingleSource/Regression/C/gcc-c-torture/execute/doloop-2.c
@@ -0,0 +1,18 @@
+#include <limits.h>
+
+extern void exit (int);
+extern void abort (void);
+
+volatile unsigned int i;
+
+int
+main (void)
+{
+ unsigned short z = 0;
+
+ do ++i;
+ while (--z > 0);
+ if (i != USHRT_MAX + 1U)
+ abort ();
+ exit (0);
+}