author | chegar |
Thu, 17 Oct 2019 20:54:25 +0100 | |
branch | datagramsocketimpl-branch |
changeset 58679 | 9c3209ff7550 |
parent 58678 | 9cf78a70fa4f |
parent 57705 | 7cf02b2c1455 |
permissions | -rw-r--r-- |
39615
9ab0913a0e65
8159890: SIGSEGV with UseStringDeduplication and UseSharedSpaces/RequireSharedSpaces
pliden
parents:
diff
changeset
|
1 |
/* |
57567
b000362a89a0
8202339: [TESTBUG] Consolidate the tests in runtime/SharedArchiveFile and runtime/appcds
coleenp
parents:
51990
diff
changeset
|
2 |
* Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. |
39615
9ab0913a0e65
8159890: SIGSEGV with UseStringDeduplication and UseSharedSpaces/RequireSharedSpaces
pliden
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
9ab0913a0e65
8159890: SIGSEGV with UseStringDeduplication and UseSharedSpaces/RequireSharedSpaces
pliden
parents:
diff
changeset
|
4 |
* |
9ab0913a0e65
8159890: SIGSEGV with UseStringDeduplication and UseSharedSpaces/RequireSharedSpaces
pliden
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
9ab0913a0e65
8159890: SIGSEGV with UseStringDeduplication and UseSharedSpaces/RequireSharedSpaces
pliden
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
9ab0913a0e65
8159890: SIGSEGV with UseStringDeduplication and UseSharedSpaces/RequireSharedSpaces
pliden
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
9ab0913a0e65
8159890: SIGSEGV with UseStringDeduplication and UseSharedSpaces/RequireSharedSpaces
pliden
parents:
diff
changeset
|
8 |
* |
9ab0913a0e65
8159890: SIGSEGV with UseStringDeduplication and UseSharedSpaces/RequireSharedSpaces
pliden
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
9ab0913a0e65
8159890: SIGSEGV with UseStringDeduplication and UseSharedSpaces/RequireSharedSpaces
pliden
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
9ab0913a0e65
8159890: SIGSEGV with UseStringDeduplication and UseSharedSpaces/RequireSharedSpaces
pliden
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
9ab0913a0e65
8159890: SIGSEGV with UseStringDeduplication and UseSharedSpaces/RequireSharedSpaces
pliden
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
9ab0913a0e65
8159890: SIGSEGV with UseStringDeduplication and UseSharedSpaces/RequireSharedSpaces
pliden
parents:
diff
changeset
|
13 |
* accompanied this code). |
9ab0913a0e65
8159890: SIGSEGV with UseStringDeduplication and UseSharedSpaces/RequireSharedSpaces
pliden
parents:
diff
changeset
|
14 |
* |
9ab0913a0e65
8159890: SIGSEGV with UseStringDeduplication and UseSharedSpaces/RequireSharedSpaces
pliden
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
9ab0913a0e65
8159890: SIGSEGV with UseStringDeduplication and UseSharedSpaces/RequireSharedSpaces
pliden
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
9ab0913a0e65
8159890: SIGSEGV with UseStringDeduplication and UseSharedSpaces/RequireSharedSpaces
pliden
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
9ab0913a0e65
8159890: SIGSEGV with UseStringDeduplication and UseSharedSpaces/RequireSharedSpaces
pliden
parents:
diff
changeset
|
18 |
* |
9ab0913a0e65
8159890: SIGSEGV with UseStringDeduplication and UseSharedSpaces/RequireSharedSpaces
pliden
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
9ab0913a0e65
8159890: SIGSEGV with UseStringDeduplication and UseSharedSpaces/RequireSharedSpaces
pliden
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
9ab0913a0e65
8159890: SIGSEGV with UseStringDeduplication and UseSharedSpaces/RequireSharedSpaces
pliden
parents:
diff
changeset
|
21 |
* questions. |
9ab0913a0e65
8159890: SIGSEGV with UseStringDeduplication and UseSharedSpaces/RequireSharedSpaces
pliden
parents:
diff
changeset
|
22 |
*/ |
9ab0913a0e65
8159890: SIGSEGV with UseStringDeduplication and UseSharedSpaces/RequireSharedSpaces
pliden
parents:
diff
changeset
|
23 |
|
46779
d80ca591ae48
8185436: jtreg: introduce @requires property to disable cds tests
goetz
parents:
46389
diff
changeset
|
24 |
/** |
39615
9ab0913a0e65
8159890: SIGSEGV with UseStringDeduplication and UseSharedSpaces/RequireSharedSpaces
pliden
parents:
diff
changeset
|
25 |
* @test SharedStringsDedup |
9ab0913a0e65
8159890: SIGSEGV with UseStringDeduplication and UseSharedSpaces/RequireSharedSpaces
pliden
parents:
diff
changeset
|
26 |
* @summary Test -Xshare:auto with shared strings and -XX:+UseStringDeduplication |
49008
d777541fceba
8191375: Add high-level jtreg VMProps to filter out CDS tests
iklam
parents:
48469
diff
changeset
|
27 |
* @requires vm.cds.archived.java.heap |
40631
ed82623d7831
8157957: ClassNotFoundException: jdk.test.lib.JDKToolFinder
ctornqvi
parents:
39615
diff
changeset
|
28 |
* @library /test/lib |
51990
6003e034cdd8
8209946: [TESTBUG] CDS tests should use "@run driver"
iklam
parents:
49008
diff
changeset
|
29 |
* @run driver SharedStringsDedup |
39615
9ab0913a0e65
8159890: SIGSEGV with UseStringDeduplication and UseSharedSpaces/RequireSharedSpaces
pliden
parents:
diff
changeset
|
30 |
*/ |
9ab0913a0e65
8159890: SIGSEGV with UseStringDeduplication and UseSharedSpaces/RequireSharedSpaces
pliden
parents:
diff
changeset
|
31 |
|
46389 | 32 |
import jdk.test.lib.cds.CDSTestUtils; |
40631
ed82623d7831
8157957: ClassNotFoundException: jdk.test.lib.JDKToolFinder
ctornqvi
parents:
39615
diff
changeset
|
33 |
import jdk.test.lib.process.OutputAnalyzer; |
39615
9ab0913a0e65
8159890: SIGSEGV with UseStringDeduplication and UseSharedSpaces/RequireSharedSpaces
pliden
parents:
diff
changeset
|
34 |
import java.io.File; |
9ab0913a0e65
8159890: SIGSEGV with UseStringDeduplication and UseSharedSpaces/RequireSharedSpaces
pliden
parents:
diff
changeset
|
35 |
|
9ab0913a0e65
8159890: SIGSEGV with UseStringDeduplication and UseSharedSpaces/RequireSharedSpaces
pliden
parents:
diff
changeset
|
36 |
// The main purpose is to test the interaction between shared strings |
9ab0913a0e65
8159890: SIGSEGV with UseStringDeduplication and UseSharedSpaces/RequireSharedSpaces
pliden
parents:
diff
changeset
|
37 |
// and -XX:+UseStringDeduplication. We run in -Xshare:auto mode so |
9ab0913a0e65
8159890: SIGSEGV with UseStringDeduplication and UseSharedSpaces/RequireSharedSpaces
pliden
parents:
diff
changeset
|
38 |
// we don't need to worry about CDS archive mapping failure (which |
9ab0913a0e65
8159890: SIGSEGV with UseStringDeduplication and UseSharedSpaces/RequireSharedSpaces
pliden
parents:
diff
changeset
|
39 |
// doesn't happen often so it won't impact coverage). |
9ab0913a0e65
8159890: SIGSEGV with UseStringDeduplication and UseSharedSpaces/RequireSharedSpaces
pliden
parents:
diff
changeset
|
40 |
public class SharedStringsDedup { |
9ab0913a0e65
8159890: SIGSEGV with UseStringDeduplication and UseSharedSpaces/RequireSharedSpaces
pliden
parents:
diff
changeset
|
41 |
public static void main(String[] args) throws Exception { |
46389 | 42 |
OutputAnalyzer out = |
49008
d777541fceba
8191375: Add high-level jtreg VMProps to filter out CDS tests
iklam
parents:
48469
diff
changeset
|
43 |
CDSTestUtils.createArchive(); |
46389 | 44 |
CDSTestUtils.checkDump(out, "Shared string table stats"); |
49008
d777541fceba
8191375: Add high-level jtreg VMProps to filter out CDS tests
iklam
parents:
48469
diff
changeset
|
45 |
CDSTestUtils.runWithArchiveAndCheck("-XX:+UseStringDeduplication"); |
39615
9ab0913a0e65
8159890: SIGSEGV with UseStringDeduplication and UseSharedSpaces/RequireSharedSpaces
pliden
parents:
diff
changeset
|
46 |
} |
9ab0913a0e65
8159890: SIGSEGV with UseStringDeduplication and UseSharedSpaces/RequireSharedSpaces
pliden
parents:
diff
changeset
|
47 |
} |