pkgsrc-ng/lang/gcc45/patches/patch-gcc_testsuite_gcc.c-torture_execute_doloop-2.c
Lionel Sambuc 612ad0a18c lang/gcc45
2016-01-22 00:09:29 +01:00

24 lines
402 B
C

$NetBSD$
--- gcc/testsuite/gcc.c-torture/execute/doloop-2.c.orig Wed May 21 19:48:58 2014
+++ gcc/testsuite/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);
+}