test/hotspot/jtreg/compiler/loopopts/superword/TestFuzzPreLoop.java
author chegar
Thu, 17 Oct 2019 20:54:25 +0100
branchdatagramsocketimpl-branch
changeset 58679 9c3209ff7550
parent 58678 9cf78a70fa4f
parent 58079 8db87a43a1ce
permissions -rw-r--r--
datagramsocketimpl-branch: merge with default
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
57976
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
     1
/*
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
     2
 * Copyright (c) 2019, Red Hat, Inc. All rights reserved.
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
     4
 *
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
     7
 * published by the Free Software Foundation.
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
     8
 *
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
    13
 * accompanied this code).
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
    14
 *
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
    18
 *
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
    21
 * questions.
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
    22
 */
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
    23
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
    24
/*
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
    25
 * @test
58079
8db87a43a1ce 8230813: Add JDK-8010500 to compiler/loopopts/superword/TestFuzzPreLoop.java bug list
shade
parents: 57976
diff changeset
    26
 * @bug 8134739 8010500
57976
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
    27
 * @summary SEGV in SuperWord::get_pre_loop_end
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
    28
 * @run main/othervm compiler.loopopts.superword.TestFuzzPreLoop
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
    29
 */
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
    30
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
    31
package compiler.loopopts.superword;
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
    32
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
    33
public class TestFuzzPreLoop {
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
    34
    static Object sink;
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
    35
    short sFld = -19206;
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
    36
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
    37
    void doTest() {
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
    38
        int[] arr = new int[400];
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
    39
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
    40
        for (int i1 = 0; i1 < 200; i1++) {
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
    41
            for (int i2 = 0; i2 < 100; i2++) {
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
    42
                sink = new int[400];
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
    43
            }
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
    44
            arr[i1] = 0;
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
    45
        }
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
    46
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
    47
        float f1 = 0;
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
    48
        for (int i3 = 0; i3 < 200; i3++) {
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
    49
            f1 += i3 * i3;
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
    50
        }
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
    51
        for (int i4 = 0; i4 < 200; i4++) {
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
    52
            f1 += i4 - sFld;
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
    53
        }
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
    54
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
    55
        System.out.println(arr);
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
    56
        System.out.println(f1);
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
    57
    }
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
    58
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
    59
    public static void main(String... args) throws Exception {
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
    60
        TestFuzzPreLoop test = new TestFuzzPreLoop();
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
    61
        for (int i = 0; i < 100; i++) {
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
    62
            test.doTest();
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
    63
        }
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
    64
    }
47ce198d5cf1 8230238: Add another regression test for JDK-8134739
shade
parents:
diff changeset
    65
}