hotspot/test/compiler/7068051/Test7068051.java
author kvn
Thu, 08 Sep 2011 12:44:04 -0700
changeset 10541 d6e8b9d3d362
child 27640 3eab5c5bf81a
permissions -rw-r--r--
7087947: Add regression test for 7068051 Summary: Add regression test. Reviewed-by: never
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10541
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
     1
/*
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
     2
 * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
     4
 *
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
     7
 * published by the Free Software Foundation.
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
     8
 *
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    13
 * accompanied this code).
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    14
 *
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    18
 *
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    21
 * questions.
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    22
 *
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    23
 */
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    24
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    25
/**
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    26
 * @test
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    27
 * @bug 7068051
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    28
 * @summary SIGSEGV in PhaseIdealLoop::build_loop_late_post on T5440
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    29
 *
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    30
 * @run shell/timeout=300 Test7068051.sh
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    31
 */
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    32
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    33
import java.io.*;
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    34
import java.nio.*;
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    35
import java.util.*;
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    36
import java.util.zip.*;
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    37
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    38
public class Test7068051 {
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    39
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    40
    public static void main (String[] args) throws Throwable {
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    41
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    42
        ZipFile zf = new ZipFile(args[0]);
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    43
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    44
        Enumeration<? extends ZipEntry> entries = zf.entries();
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    45
        ArrayList<String> names = new ArrayList<String>();
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    46
        while (entries.hasMoreElements()) {
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    47
            names.add(entries.nextElement().getName());
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    48
        }
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    49
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    50
        byte[] bytes = new byte[16];
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    51
        for (String name : names) {
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    52
            ZipEntry e = zf.getEntry(name);
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    53
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    54
            if (e.isDirectory())
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    55
                continue;
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    56
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    57
            final InputStream is = zf.getInputStream(e);
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    58
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    59
            try  {
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    60
                while (is.read(bytes) >= 0) {
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    61
                }
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    62
                is.close();
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    63
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    64
            } catch (IOException x) {
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    65
                 System.out.println("..................................");
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    66
                 System.out.println("          -->  is :" + is);
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    67
                 System.out.println("          is.hash :" + is.hashCode());
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    68
                 System.out.println();
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    69
                 System.out.println("           e.name :" + e.getName());
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    70
                 System.out.println("           e.hash :" + e.hashCode());
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    71
                 System.out.println("         e.method :" + e.getMethod());
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    72
                 System.out.println("           e.size :" + e.getSize());
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    73
                 System.out.println("          e.csize :" + e.getCompressedSize());
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    74
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    75
                 x.printStackTrace();
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    76
                 System.out.println("..................................");
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    77
                 System.exit(97);
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    78
            }
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    79
        }
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    80
        zf.close();
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    81
    }
d6e8b9d3d362 7087947: Add regression test for 7068051
kvn
parents:
diff changeset
    82
}