提交 15dd0e04 编写于 作者: C csahu

8073735: [TEST_BUG] compiler/loopopts/CountedLoopProblem.java got OOME

Summary: Ignore OOM in the test
Reviewed-by: kvn
上级 8f491dd9
...@@ -36,6 +36,7 @@ public class CountedLoopProblem { ...@@ -36,6 +36,7 @@ public class CountedLoopProblem {
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
Random r = new Random(42); Random r = new Random(42);
int x = 0; int x = 0;
try {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
for(int i = 0; i < 1000000; ++i) { for(int i = 0; i < 1000000; ++i) {
int v = Math.abs(r.nextInt()); int v = Math.abs(r.nextInt());
...@@ -49,6 +50,9 @@ public class CountedLoopProblem { ...@@ -49,6 +50,9 @@ public class CountedLoopProblem {
if (sb.toString().hashCode() != 0xaba94591) { if (sb.toString().hashCode() != 0xaba94591) {
throw new Exception("Unexpected result"); throw new Exception("Unexpected result");
} }
} catch(OutOfMemoryError e) {
// small heap, ignore
}
} }
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册