summaryrefslogtreecommitdiffstats
path: root/test/109-suspend-check/src/Main.java
diff options
context:
space:
mode:
Diffstat (limited to 'test/109-suspend-check/src/Main.java')
-rw-r--r--test/109-suspend-check/src/Main.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/109-suspend-check/src/Main.java b/test/109-suspend-check/src/Main.java
index 8046d75..3c3353b 100644
--- a/test/109-suspend-check/src/Main.java
+++ b/test/109-suspend-check/src/Main.java
@@ -32,6 +32,8 @@ public class Main {
new InfiniteWhileLoopWithSpecialPutOrNop(new SpecialMethods2()),
new InfiniteWhileLoopWithSpecialConstOrIGet(new SpecialMethods1()),
new InfiniteWhileLoopWithSpecialConstOrIGet(new SpecialMethods2()),
+ new InfiniteWhileLoopWithSpecialConstOrIGetInTryCatch(new SpecialMethods1()),
+ new InfiniteWhileLoopWithSpecialConstOrIGetInTryCatch(new SpecialMethods2()),
};
doWhileLoopWithLong.start();
for (SimpleLoopThread loop : simpleLoops) {
@@ -135,6 +137,21 @@ class InfiniteWhileLoopWithSpecialConstOrIGet extends SimpleLoopThread {
}
}
+class InfiniteWhileLoopWithSpecialConstOrIGetInTryCatch extends SimpleLoopThread {
+ private SpecialMethodInterface smi;
+ public InfiniteWhileLoopWithSpecialConstOrIGetInTryCatch(SpecialMethodInterface smi) {
+ this.smi = smi;
+ }
+ public void run() {
+ try {
+ long i = 0L;
+ while (keepGoing) {
+ i += smi.ConstOrIGet();
+ }
+ } catch (Throwable ignored) { }
+ }
+}
+
class InfiniteWhileLoopWithIntrinsic extends SimpleLoopThread {
private String[] strings = { "a", "b", "c", "d" };
private int sum = 0;