diff options
author | Raja R Harinath <harinath@hurrynot.org> | 2006-05-18 15:02:03 +0400 |
---|---|---|
committer | Raja R Harinath <harinath@hurrynot.org> | 2006-05-18 15:02:03 +0400 |
commit | 934fecbaef55903e227b8ad1906ce86b65d88932 (patch) | |
tree | 5792d8fed878257be78d4d957ab474c8574fe4e2 /mcs/tests/test-516.cs | |
parent | 113555630949fcd9b125c1ddfeb8a3fb6e2e69a9 (diff) |
The 'piece de resistance' -- the culmination of the re-factoring effort :-)
In mcs:
Fix #77869, #76148, #77755, #75255 and a host of other bugs.
This is still "wrong", but anything better would probably need a
multi-pass algorithm.
* flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
usage vector. Force current usage vector to be reachable, to
optimistically signify backward jumps.
(FlowBranchingLabeled.LookupLabel): Note if a backward jump is
detected.
(FlowBranchingLabeled.Merge): New. If no backward jump was
detected, return the original salted-away usage vector instead,
updated with appropriate changes. Print unreachable warning if
necessary.
* statement.cs (Block.Resolve): Don't print unreachable warning on
a labeled statement.
In gmcs:
Fix #77869, #76148, #77755, #75255 and a host of other bugs.
This is still "wrong", but anything better would probably need a
multi-pass algorithm.
* flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
usage vector. Force current usage vector to be reachable, to
optimistically signify backward jumps.
(FlowBranchingLabeled.LookupLabel): Note if a backward jump is
detected.
(FlowBranchingLabeled.Merge): New. If no backward jump was
detected, return the original salted-away usage vector instead,
updated with appropriate changes. Print unreachable warning if
necessary.
* statement.cs (Block.Resolve): Don't print unreachable warning on
a labeled statement.
In tests:
* test-514.cs: New test from #76148.
* test-515.cs, test-516.cs: New tests based on #77755.
* test-517.cs: New test based on #75255.
In errors:
* cs0162-6.cs, cs0162-7.cs: New tests for unreachable code.
Emitting the warning on cs0162-7.cs needs a multi-pass algorithm.
* cs0165-12.cs: New test from #77869.
svn path=/trunk/mcs/; revision=60813
Diffstat (limited to 'mcs/tests/test-516.cs')
-rw-r--r-- | mcs/tests/test-516.cs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/mcs/tests/test-516.cs b/mcs/tests/test-516.cs new file mode 100644 index 00000000000..dde3fa3ece0 --- /dev/null +++ b/mcs/tests/test-516.cs @@ -0,0 +1,17 @@ +// Compiler options: -warnaserror -warn:2 + +// Same as test-515, but we're checking that there's no "unreachable code" warning either + +class X { + static void Main () + { + int i = 0; + goto a; + b: + if (++ i > 1) + throw new System.Exception ("infloop!!!"); + return; + a: + goto b; + } +} |