hotspot/test/compiler/ciReplay/TestSA.sh
author chegar
Tue, 22 Mar 2016 15:26:07 +0000
changeset 36694 182a5e7a519e
parent 28385 bec02e2cbde7
child 39439 e40793a03c90
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
17123
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
     1
#!/bin/sh
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
     2
# 
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
     3
# Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
     4
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
     5
# 
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
     6
# This code is free software; you can redistribute it and/or modify it
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
     7
# under the terms of the GNU General Public License version 2 only, as
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
     8
# published by the Free Software Foundation.
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
     9
# 
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    10
# This code is distributed in the hope that it will be useful, but WITHOUT
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    11
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    12
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    13
# version 2 for more details (a copy is included in the LICENSE file that
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    14
# accompanied this code).
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    15
# 
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    16
# You should have received a copy of the GNU General Public License version
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    17
# 2 along with this work; if not, write to the Free Software Foundation,
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    18
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    19
# 
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    20
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    21
# or visit www.oracle.com if you need additional information or have any
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    22
# questions.
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    23
# 
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    24
# 
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    25
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    26
##
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    27
## @test
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    28
## @bug 8011675
28385
bec02e2cbde7 8062012: test/compiler/ciReplay/TestSA.sh should be updated to work w/ modular image build
tpivovarova
parents: 25924
diff changeset
    29
## @ignore 8029528
17123
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    30
## @summary testing of ciReplay with using generated by SA replay.txt 
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    31
## @author igor.ignatyev@oracle.com
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    32
## @run shell TestSA.sh
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    33
##
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    34
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    35
if [ "${TESTSRC}" = "" ]
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    36
then
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    37
  TESTSRC=${PWD}
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    38
  echo "TESTSRC not set.  Using "${TESTSRC}" as default"
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    39
fi
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    40
echo "TESTSRC=${TESTSRC}"
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    41
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    42
## Adding common setup Variables for running shell tests.
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    43
. ${TESTSRC}/../../test_env.sh
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    44
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    45
. ${TESTSRC}/common.sh
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    46
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    47
generate_replay
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    48
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    49
${MV} ${replay_data} replay_vm.txt    
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    50
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    51
if [ -z "${core_file}" -o ! -r "${core_file}" ]
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    52
then
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    53
    # skip test if MacOS host isn't configured for core dumping
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    54
    if [ "$OS" = "Darwin" ]
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    55
    then
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    56
        if [ ! -d "/cores" ]
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    57
        then
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    58
            echo TEST SKIPPED: \'/cores\' dir doens\'t exist
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    59
            exit 0
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    60
        fi
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    61
        if [ ! -w "/cores" ]
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    62
        then
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    63
            echo TEST SKIPPED: \'/cores\' dir exists but is not writable
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    64
            exit 0
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    65
        fi
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    66
    fi
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    67
    test_fail 2 "CHECK :: CORE GENERATION" "core wasn't generated on $OS"
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    68
fi
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    69
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    70
echo "dumpreplaydata -a > ${replay_data}" | \
25924
4c3dd8541530 8051896: jtreg tests don't use $TESTJAVAOPTS
iignatyev
parents: 25737
diff changeset
    71
        ${JAVA} ${TESTOPTS} \
17123
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    72
        sun.jvm.hotspot.CLHSDB  ${JAVA} ${core_file}
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    73
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    74
if [ ! -s ${replay_data} ]
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    75
then
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    76
    test_fail 1 "CHECK :: REPLAY DATA GENERATION" \
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    77
        "replay data wasn't generated by SA"
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    78
fi
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    79
17387
201ce4a5360b 8014068: TEST_BUG: compiler/ciReplay/TestSA.sh fails on Windows: core wasn't generated
iignatyev
parents: 17123
diff changeset
    80
diff ${replay_data} replay_vm.txt > replay.diff 2>&1
201ce4a5360b 8014068: TEST_BUG: compiler/ciReplay/TestSA.sh fails on Windows: core wasn't generated
iignatyev
parents: 17123
diff changeset
    81
if [ -s replay.diff ]
17123
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    82
then
17387
201ce4a5360b 8014068: TEST_BUG: compiler/ciReplay/TestSA.sh fails on Windows: core wasn't generated
iignatyev
parents: 17123
diff changeset
    83
    echo WARNING: replay.txt from SA != replay.txt from VM:
201ce4a5360b 8014068: TEST_BUG: compiler/ciReplay/TestSA.sh fails on Windows: core wasn't generated
iignatyev
parents: 17123
diff changeset
    84
    cat replay.diff
17123
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    85
fi
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    86
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    87
common_tests 10 
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    88
${VM_TYPE}_tests 20
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    89
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    90
cleanup
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    91
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    92
echo TEST PASSED
a8e62eed2e3e 8011675: adding compilation level to replay data
iignatyev
parents:
diff changeset
    93