Mercurial > hg > truffle
annotate test/runtime/CommandLine/ConfigFileParsing.java @ 12986:1b422ef5288a
8025728: Missing volatile specifier for field G1AllocRegion::_alloc_region
Summary: The field G1AllocRegion::_alloc_region needs to be declared volatile as it is used with that intention. Otherwise the compiler may generate the code that reloads the value which might have changed in the meantime, leading to spurious crashes.
Reviewed-by: iveresov, simonis, tschatzl
Contributed-by: Axel Siebenborn <axel.siebenborn@sap.com>
author | tschatzl |
---|---|
date | Wed, 23 Oct 2013 10:23:06 +0200 |
parents | 243469d929e6 |
children |
rev | line source |
---|---|
10300
243469d929e6
8008169: test/runtime/7158804/Test7158804.sh has bad copyright header
ctornqvi
parents:
8831
diff
changeset
|
1 /* |
243469d929e6
8008169: test/runtime/7158804/Test7158804.sh has bad copyright header
ctornqvi
parents:
8831
diff
changeset
|
2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. |
243469d929e6
8008169: test/runtime/7158804/Test7158804.sh has bad copyright header
ctornqvi
parents:
8831
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
243469d929e6
8008169: test/runtime/7158804/Test7158804.sh has bad copyright header
ctornqvi
parents:
8831
diff
changeset
|
4 * |
243469d929e6
8008169: test/runtime/7158804/Test7158804.sh has bad copyright header
ctornqvi
parents:
8831
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
243469d929e6
8008169: test/runtime/7158804/Test7158804.sh has bad copyright header
ctornqvi
parents:
8831
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
243469d929e6
8008169: test/runtime/7158804/Test7158804.sh has bad copyright header
ctornqvi
parents:
8831
diff
changeset
|
7 * published by the Free Software Foundation. |
243469d929e6
8008169: test/runtime/7158804/Test7158804.sh has bad copyright header
ctornqvi
parents:
8831
diff
changeset
|
8 * |
243469d929e6
8008169: test/runtime/7158804/Test7158804.sh has bad copyright header
ctornqvi
parents:
8831
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
243469d929e6
8008169: test/runtime/7158804/Test7158804.sh has bad copyright header
ctornqvi
parents:
8831
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
243469d929e6
8008169: test/runtime/7158804/Test7158804.sh has bad copyright header
ctornqvi
parents:
8831
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
243469d929e6
8008169: test/runtime/7158804/Test7158804.sh has bad copyright header
ctornqvi
parents:
8831
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
243469d929e6
8008169: test/runtime/7158804/Test7158804.sh has bad copyright header
ctornqvi
parents:
8831
diff
changeset
|
13 * accompanied this code). |
243469d929e6
8008169: test/runtime/7158804/Test7158804.sh has bad copyright header
ctornqvi
parents:
8831
diff
changeset
|
14 * |
243469d929e6
8008169: test/runtime/7158804/Test7158804.sh has bad copyright header
ctornqvi
parents:
8831
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
243469d929e6
8008169: test/runtime/7158804/Test7158804.sh has bad copyright header
ctornqvi
parents:
8831
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
243469d929e6
8008169: test/runtime/7158804/Test7158804.sh has bad copyright header
ctornqvi
parents:
8831
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
243469d929e6
8008169: test/runtime/7158804/Test7158804.sh has bad copyright header
ctornqvi
parents:
8831
diff
changeset
|
18 * |
243469d929e6
8008169: test/runtime/7158804/Test7158804.sh has bad copyright header
ctornqvi
parents:
8831
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
243469d929e6
8008169: test/runtime/7158804/Test7158804.sh has bad copyright header
ctornqvi
parents:
8831
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
243469d929e6
8008169: test/runtime/7158804/Test7158804.sh has bad copyright header
ctornqvi
parents:
8831
diff
changeset
|
21 * questions. |
243469d929e6
8008169: test/runtime/7158804/Test7158804.sh has bad copyright header
ctornqvi
parents:
8831
diff
changeset
|
22 */ |
6901 | 23 |
10300
243469d929e6
8008169: test/runtime/7158804/Test7158804.sh has bad copyright header
ctornqvi
parents:
8831
diff
changeset
|
24 /* |
243469d929e6
8008169: test/runtime/7158804/Test7158804.sh has bad copyright header
ctornqvi
parents:
8831
diff
changeset
|
25 * @test ConfigFileParsing |
243469d929e6
8008169: test/runtime/7158804/Test7158804.sh has bad copyright header
ctornqvi
parents:
8831
diff
changeset
|
26 * @bug 7158804 |
243469d929e6
8008169: test/runtime/7158804/Test7158804.sh has bad copyright header
ctornqvi
parents:
8831
diff
changeset
|
27 * @summary Improve config file parsing |
243469d929e6
8008169: test/runtime/7158804/Test7158804.sh has bad copyright header
ctornqvi
parents:
8831
diff
changeset
|
28 * @library /testlibrary |
243469d929e6
8008169: test/runtime/7158804/Test7158804.sh has bad copyright header
ctornqvi
parents:
8831
diff
changeset
|
29 */ |
243469d929e6
8008169: test/runtime/7158804/Test7158804.sh has bad copyright header
ctornqvi
parents:
8831
diff
changeset
|
30 |
243469d929e6
8008169: test/runtime/7158804/Test7158804.sh has bad copyright header
ctornqvi
parents:
8831
diff
changeset
|
31 import java.io.PrintWriter; |
243469d929e6
8008169: test/runtime/7158804/Test7158804.sh has bad copyright header
ctornqvi
parents:
8831
diff
changeset
|
32 import com.oracle.java.testlibrary.*; |
243469d929e6
8008169: test/runtime/7158804/Test7158804.sh has bad copyright header
ctornqvi
parents:
8831
diff
changeset
|
33 |
243469d929e6
8008169: test/runtime/7158804/Test7158804.sh has bad copyright header
ctornqvi
parents:
8831
diff
changeset
|
34 public class ConfigFileParsing { |
243469d929e6
8008169: test/runtime/7158804/Test7158804.sh has bad copyright header
ctornqvi
parents:
8831
diff
changeset
|
35 public static void main(String[] args) throws Exception { |
243469d929e6
8008169: test/runtime/7158804/Test7158804.sh has bad copyright header
ctornqvi
parents:
8831
diff
changeset
|
36 String testFileName = ".hotspotrc"; |
6901 | 37 |
10300
243469d929e6
8008169: test/runtime/7158804/Test7158804.sh has bad copyright header
ctornqvi
parents:
8831
diff
changeset
|
38 // Create really long invalid option |
243469d929e6
8008169: test/runtime/7158804/Test7158804.sh has bad copyright header
ctornqvi
parents:
8831
diff
changeset
|
39 String reallyLongInvalidOption = ""; |
243469d929e6
8008169: test/runtime/7158804/Test7158804.sh has bad copyright header
ctornqvi
parents:
8831
diff
changeset
|
40 for (int i=0; i<5000; i++) |
243469d929e6
8008169: test/runtime/7158804/Test7158804.sh has bad copyright header
ctornqvi
parents:
8831
diff
changeset
|
41 reallyLongInvalidOption+='a'; |
243469d929e6
8008169: test/runtime/7158804/Test7158804.sh has bad copyright header
ctornqvi
parents:
8831
diff
changeset
|
42 |
243469d929e6
8008169: test/runtime/7158804/Test7158804.sh has bad copyright header
ctornqvi
parents:
8831
diff
changeset
|
43 // Populate the options file with really long string |
243469d929e6
8008169: test/runtime/7158804/Test7158804.sh has bad copyright header
ctornqvi
parents:
8831
diff
changeset
|
44 PrintWriter pw = new PrintWriter(testFileName); |
243469d929e6
8008169: test/runtime/7158804/Test7158804.sh has bad copyright header
ctornqvi
parents:
8831
diff
changeset
|
45 pw.println("-XX:+" + reallyLongInvalidOption); |
243469d929e6
8008169: test/runtime/7158804/Test7158804.sh has bad copyright header
ctornqvi
parents:
8831
diff
changeset
|
46 pw.close(); |
243469d929e6
8008169: test/runtime/7158804/Test7158804.sh has bad copyright header
ctornqvi
parents:
8831
diff
changeset
|
47 |
243469d929e6
8008169: test/runtime/7158804/Test7158804.sh has bad copyright header
ctornqvi
parents:
8831
diff
changeset
|
48 // start VM |
243469d929e6
8008169: test/runtime/7158804/Test7158804.sh has bad copyright header
ctornqvi
parents:
8831
diff
changeset
|
49 ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( |
243469d929e6
8008169: test/runtime/7158804/Test7158804.sh has bad copyright header
ctornqvi
parents:
8831
diff
changeset
|
50 "-XX:+IgnoreUnrecognizedVMOptions", "-XX:Flags=.hotspotrc", "-version"); |
243469d929e6
8008169: test/runtime/7158804/Test7158804.sh has bad copyright header
ctornqvi
parents:
8831
diff
changeset
|
51 |
243469d929e6
8008169: test/runtime/7158804/Test7158804.sh has bad copyright header
ctornqvi
parents:
8831
diff
changeset
|
52 OutputAnalyzer output = new OutputAnalyzer(pb.start()); |
243469d929e6
8008169: test/runtime/7158804/Test7158804.sh has bad copyright header
ctornqvi
parents:
8831
diff
changeset
|
53 output.shouldHaveExitValue(0); |
243469d929e6
8008169: test/runtime/7158804/Test7158804.sh has bad copyright header
ctornqvi
parents:
8831
diff
changeset
|
54 } |
243469d929e6
8008169: test/runtime/7158804/Test7158804.sh has bad copyright header
ctornqvi
parents:
8831
diff
changeset
|
55 } |