summaryrefslogtreecommitdiff
path: root/tests/sources/0508_loop_init.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/sources/0508_loop_init.c')
-rw-r--r--tests/sources/0508_loop_init.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/sources/0508_loop_init.c b/tests/sources/0508_loop_init.c
new file mode 100644
index 0000000..f0817e5
--- /dev/null
+++ b/tests/sources/0508_loop_init.c
@@ -0,0 +1,14 @@
+int init;
+int x;
+
+init = 0;
+while (rand(0,1)==0) {
+ if (init == 0) {
+ x = 0;
+ init = 1;
+ }
+ else {
+ x = x + 1;
+ }
+ assert(x >= 0);
+}