Mercurial > hg > truffle
annotate test/compiler/6855164/Test.java @ 4997:0c9196f57172
use profiling information whenever possible
author | Christian Haeubl <christian.haeubl@oracle.com> |
---|---|
date | Wed, 29 Feb 2012 19:20:15 -0800 |
parents | c18cbe5936b8 |
children |
rev | line source |
---|---|
835
73dac61fe300
6857707: Add missing test case for CR 6855164 from its bug description.
cfang
parents:
diff
changeset
|
1 /* |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
835
diff
changeset
|
2 * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. |
835
73dac61fe300
6857707: Add missing test case for CR 6855164 from its bug description.
cfang
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
73dac61fe300
6857707: Add missing test case for CR 6855164 from its bug description.
cfang
parents:
diff
changeset
|
4 * |
73dac61fe300
6857707: Add missing test case for CR 6855164 from its bug description.
cfang
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
73dac61fe300
6857707: Add missing test case for CR 6855164 from its bug description.
cfang
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
73dac61fe300
6857707: Add missing test case for CR 6855164 from its bug description.
cfang
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
73dac61fe300
6857707: Add missing test case for CR 6855164 from its bug description.
cfang
parents:
diff
changeset
|
8 * |
73dac61fe300
6857707: Add missing test case for CR 6855164 from its bug description.
cfang
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
73dac61fe300
6857707: Add missing test case for CR 6855164 from its bug description.
cfang
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
73dac61fe300
6857707: Add missing test case for CR 6855164 from its bug description.
cfang
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
73dac61fe300
6857707: Add missing test case for CR 6855164 from its bug description.
cfang
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
73dac61fe300
6857707: Add missing test case for CR 6855164 from its bug description.
cfang
parents:
diff
changeset
|
13 * accompanied this code). |
73dac61fe300
6857707: Add missing test case for CR 6855164 from its bug description.
cfang
parents:
diff
changeset
|
14 * |
73dac61fe300
6857707: Add missing test case for CR 6855164 from its bug description.
cfang
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
73dac61fe300
6857707: Add missing test case for CR 6855164 from its bug description.
cfang
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
73dac61fe300
6857707: Add missing test case for CR 6855164 from its bug description.
cfang
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
73dac61fe300
6857707: Add missing test case for CR 6855164 from its bug description.
cfang
parents:
diff
changeset
|
18 * |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
835
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
835
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
835
diff
changeset
|
21 * questions. |
835
73dac61fe300
6857707: Add missing test case for CR 6855164 from its bug description.
cfang
parents:
diff
changeset
|
22 */ |
73dac61fe300
6857707: Add missing test case for CR 6855164 from its bug description.
cfang
parents:
diff
changeset
|
23 |
73dac61fe300
6857707: Add missing test case for CR 6855164 from its bug description.
cfang
parents:
diff
changeset
|
24 /* |
73dac61fe300
6857707: Add missing test case for CR 6855164 from its bug description.
cfang
parents:
diff
changeset
|
25 * @test |
73dac61fe300
6857707: Add missing test case for CR 6855164 from its bug description.
cfang
parents:
diff
changeset
|
26 * @bug 6855164 |
73dac61fe300
6857707: Add missing test case for CR 6855164 from its bug description.
cfang
parents:
diff
changeset
|
27 * @summary SIGSEGV during compilation of method involving loop over CharSequence |
73dac61fe300
6857707: Add missing test case for CR 6855164 from its bug description.
cfang
parents:
diff
changeset
|
28 * @run main/othervm -Xbatch Test |
73dac61fe300
6857707: Add missing test case for CR 6855164 from its bug description.
cfang
parents:
diff
changeset
|
29 */ |
73dac61fe300
6857707: Add missing test case for CR 6855164 from its bug description.
cfang
parents:
diff
changeset
|
30 |
73dac61fe300
6857707: Add missing test case for CR 6855164 from its bug description.
cfang
parents:
diff
changeset
|
31 public class Test{ |
73dac61fe300
6857707: Add missing test case for CR 6855164 from its bug description.
cfang
parents:
diff
changeset
|
32 public static void main(String[] args) throws Exception { |
73dac61fe300
6857707: Add missing test case for CR 6855164 from its bug description.
cfang
parents:
diff
changeset
|
33 StringBuffer builder = new StringBuffer(); |
73dac61fe300
6857707: Add missing test case for CR 6855164 from its bug description.
cfang
parents:
diff
changeset
|
34 |
73dac61fe300
6857707: Add missing test case for CR 6855164 from its bug description.
cfang
parents:
diff
changeset
|
35 for(int i = 0; i < 100; i++) |
73dac61fe300
6857707: Add missing test case for CR 6855164 from its bug description.
cfang
parents:
diff
changeset
|
36 builder.append("I am the very model of a modern major general\n"); |
73dac61fe300
6857707: Add missing test case for CR 6855164 from its bug description.
cfang
parents:
diff
changeset
|
37 |
73dac61fe300
6857707: Add missing test case for CR 6855164 from its bug description.
cfang
parents:
diff
changeset
|
38 for(int j = 0; j < builder.length(); j++){ |
73dac61fe300
6857707: Add missing test case for CR 6855164 from its bug description.
cfang
parents:
diff
changeset
|
39 previousSpaceIndex(builder, j); |
73dac61fe300
6857707: Add missing test case for CR 6855164 from its bug description.
cfang
parents:
diff
changeset
|
40 } |
73dac61fe300
6857707: Add missing test case for CR 6855164 from its bug description.
cfang
parents:
diff
changeset
|
41 } |
73dac61fe300
6857707: Add missing test case for CR 6855164 from its bug description.
cfang
parents:
diff
changeset
|
42 |
73dac61fe300
6857707: Add missing test case for CR 6855164 from its bug description.
cfang
parents:
diff
changeset
|
43 private static final int previousSpaceIndex(CharSequence sb, int seek) { |
73dac61fe300
6857707: Add missing test case for CR 6855164 from its bug description.
cfang
parents:
diff
changeset
|
44 seek--; |
73dac61fe300
6857707: Add missing test case for CR 6855164 from its bug description.
cfang
parents:
diff
changeset
|
45 while (seek > 0) { |
73dac61fe300
6857707: Add missing test case for CR 6855164 from its bug description.
cfang
parents:
diff
changeset
|
46 if (sb.charAt(seek) == ' ') { |
73dac61fe300
6857707: Add missing test case for CR 6855164 from its bug description.
cfang
parents:
diff
changeset
|
47 while (seek > 0 && sb.charAt(seek - 1) == ' ') |
73dac61fe300
6857707: Add missing test case for CR 6855164 from its bug description.
cfang
parents:
diff
changeset
|
48 seek--; |
73dac61fe300
6857707: Add missing test case for CR 6855164 from its bug description.
cfang
parents:
diff
changeset
|
49 return seek; |
73dac61fe300
6857707: Add missing test case for CR 6855164 from its bug description.
cfang
parents:
diff
changeset
|
50 } |
73dac61fe300
6857707: Add missing test case for CR 6855164 from its bug description.
cfang
parents:
diff
changeset
|
51 seek--; |
73dac61fe300
6857707: Add missing test case for CR 6855164 from its bug description.
cfang
parents:
diff
changeset
|
52 } |
73dac61fe300
6857707: Add missing test case for CR 6855164 from its bug description.
cfang
parents:
diff
changeset
|
53 return 0; |
73dac61fe300
6857707: Add missing test case for CR 6855164 from its bug description.
cfang
parents:
diff
changeset
|
54 } |
73dac61fe300
6857707: Add missing test case for CR 6855164 from its bug description.
cfang
parents:
diff
changeset
|
55 } |