annotate test/compiler/6855164/Test.java @ 1314:3f0549ed0c98

6921710: G1: assert(new_finger >= _finger && new_finger < _region_limit,"invariant") Summary: If CM task was aborted while scanning the last object of the specified region and the size of that object is equal to bitmap's granularity then the next offset would be equal or over the region limit which is exactly what the assertion states. Reviewed-by: ysr, tonyp, jmasa
author apetrusenko
date Thu, 18 Mar 2010 01:48:28 -0700
parents 73dac61fe300
children c18cbe5936b8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
835
73dac61fe300 6857707: Add missing test case for CR 6855164 from its bug description.
cfang
parents:
diff changeset
1 /*
73dac61fe300 6857707: Add missing test case for CR 6855164 from its bug description.
cfang
parents:
diff changeset
2 * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
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 *
73dac61fe300 6857707: Add missing test case for CR 6855164 from its bug description.
cfang
parents:
diff changeset
19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
73dac61fe300 6857707: Add missing test case for CR 6855164 from its bug description.
cfang
parents:
diff changeset
20 * CA 95054 USA or visit www.sun.com if you need additional information or
73dac61fe300 6857707: Add missing test case for CR 6855164 from its bug description.
cfang
parents:
diff changeset
21 * have any questions.
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 }