From c015d3a3d7072df87d8fe664d11d80ead8216c37 Mon Sep 17 00:00:00 2001 From: Martin Baulig Date: Sun, 23 Feb 2003 18:39:31 +0000 Subject: [PATCH] 2003-02-23 Martin Baulig * test-185.cs: New test for bug #37708. svn path=/trunk/mcs/; revision=11875 --- mcs/tests/ChangeLog | 4 ++++ mcs/tests/README.tests | 6 +++++- mcs/tests/makefile | 2 +- mcs/tests/test-185.cs | 27 +++++++++++++++++++++++++++ 4 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 mcs/tests/test-185.cs diff --git a/mcs/tests/ChangeLog b/mcs/tests/ChangeLog index 70226a6b363..44d68ec5277 100755 --- a/mcs/tests/ChangeLog +++ b/mcs/tests/ChangeLog @@ -8,6 +8,10 @@ test-176 test-177 test-179 test-180 test-181 test-182 test-183 test-184 +2003-02-23 Martin Baulig + + * test-185.cs: New test for bug #37708. + 2003-02-15 Miguel de Icaza * test-128.cs: Improved testl, reflects bug #37363 problems diff --git a/mcs/tests/README.tests b/mcs/tests/README.tests index 27c11d806c8..b7d0d90ffab 100644 --- a/mcs/tests/README.tests +++ b/mcs/tests/README.tests @@ -39,7 +39,7 @@ Test cases listed by Category: * Flow Analysis - test-154.cs test-162.cs + test-154.cs test-162.cs test-185.cs * Type Containers @@ -170,6 +170,10 @@ test-175.cs Check for user-defined implicit conversions if both arguments of a binary operator are of a user-defined type. Bug #30443. +test-185.cs +----------- +Flow analysis wrt. infinite loops. Bug #37708. + verify-1.cs ----------- Test whether we do not jump out of the method in a Try/Finally block. diff --git a/mcs/tests/makefile b/mcs/tests/makefile index 9cacae5c36b..a68f12423c5 100755 --- a/mcs/tests/makefile +++ b/mcs/tests/makefile @@ -31,7 +31,7 @@ TEST_SOURCES = \ test-153 test-154 test-155 test-156 test-157 test-158 test-159 test-160 \ test-161 test-162 test-163 test-164 test-165 test-166 test-167 test-168 test-169 test-170 \ test-172 test-173 test-174 test-175 test-176 test-177 test-179\ - test-180 test-181 test-182 test-183 test-184 + test-180 test-181 test-182 test-183 test-184 test-185 # # NOTE: Slot test-178 is free, turns out it was an unsafe test. diff --git a/mcs/tests/test-185.cs b/mcs/tests/test-185.cs new file mode 100644 index 00000000000..6f06b22be69 --- /dev/null +++ b/mcs/tests/test-185.cs @@ -0,0 +1,27 @@ +using System; + +class X +{ + public static int Test (int x) + { + for (;;) { + if (x != 1) + x--; + else + break; + return 5; + } + return 0; + } + + static int Main () + { + if (Test (1) != 0) + return 1; + + if (Test (2) != 5) + return 2; + + return 0; + } +} -- 2.25.1