2010-07-22 11:02:54 -07:00
|
|
|
/*
|
2020-12-30 17:20:54 +00:00
|
|
|
* @test /nodynamiccopyright/
|
2019-06-10 05:09:52 +02:00
|
|
|
* @bug 8223305
|
|
|
|
* @summary Ensure javac is not crashing for wrong breaks.
|
2019-11-12 06:32:13 +00:00
|
|
|
* @compile/fail/ref=WrongBreakTest.out -XDrawDiagnostics -XDshould-stop.at=FLOW WrongBreakTest.java
|
2019-06-10 05:09:52 +02:00
|
|
|
*/
|
2010-07-22 11:02:54 -07:00
|
|
|
|
2019-06-10 05:09:52 +02:00
|
|
|
public class WrongBreakTest {
|
|
|
|
|
|
|
|
void test(int i) {
|
|
|
|
int s = 0;
|
|
|
|
int j = switch (s) { default: break; };
|
|
|
|
test(switch (s) { default: yield; });
|
|
|
|
Runnable r = () -> {
|
|
|
|
yield 15;
|
|
|
|
};
|
2018-08-29 09:36:17 +02:00
|
|
|
while (true) {
|
2019-06-10 05:09:52 +02:00
|
|
|
yield 15;
|
2018-08-29 09:36:17 +02:00
|
|
|
}
|
2010-07-22 11:02:54 -07:00
|
|
|
}
|
2019-06-10 05:09:52 +02:00
|
|
|
|
|
|
|
void test(Object o) {}
|
2010-07-22 11:02:54 -07:00
|
|
|
}
|