test/hotspot/jtreg/compiler/arraycopy/TestArrayCopyUNCBadMem.java
author jlaskey
Thu, 14 Nov 2019 12:39:56 -0400
branchJDK-8193209-branch
changeset 59087 effb66aab08b
parent 47216 71c04702a3d5
permissions -rw-r--r--
[mq]: other
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
43483
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
     1
/*
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
     2
 * Copyright (c) 2017, Red Hat, Inc. All rights reserved.
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
     4
 *
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
     7
 * published by the Free Software Foundation.
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
     8
 *
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
    13
 * accompanied this code).
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
    14
 *
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
    18
 *
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
    21
 * questions.
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
    22
 */
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
    23
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
    24
/**
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
    25
 * @test
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
    26
 * @bug 8173147
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
    27
 * @summary Loads generated at uncommon trap from eliminated arraycopy have incorrect memory state
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
    28
 * @run main/othervm -XX:CompileOnly=TestArrayCopyUNCBadMem::test -Xcomp TestArrayCopyUNCBadMem
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
    29
 *
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
    30
 */
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
    31
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
    32
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
    33
public class TestArrayCopyUNCBadMem {
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
    34
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
    35
    volatile static int field;
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
    36
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
    37
    static class unloaded {
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
    38
        static int dummy;
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
    39
    }
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
    40
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
    41
    static int test(int[] input) {
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
    42
        int[] alloc = new int[10];
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
    43
        System.arraycopy(input, 0, alloc, 0, 10);
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
    44
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
    45
        // membars to have anti-dependence edges and make scheduling
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
    46
        // fail
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
    47
        field = 0x42;
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
    48
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
    49
        // uncommon trap
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
    50
        unloaded.dummy = 0x42;
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
    51
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
    52
        return alloc[0] + alloc[1];
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
    53
    }
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
    54
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
    55
    public static void main(String[] args) {
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
    56
        int[] array = new int[10];
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
    57
        System.arraycopy(array, 0, array, 0, 0); // load System class
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
    58
        test(array);
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
    59
    }
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents:
diff changeset
    60
}