Mercurial > hg > truffle
annotate test/compiler/codegen/LoadWithMask2.java @ 18489:1a21e7ced544
Add missing javadoc.
author | Roland Schatz <roland.schatz@oracle.com> |
---|---|
date | Mon, 24 Nov 2014 13:20:02 +0100 |
parents | 7e8bd81ce93e |
children |
rev | line source |
---|---|
14271
7e8bd81ce93e
8031743: C2: loadI2L_immI broken for negative memory values
iveresov
parents:
diff
changeset
|
1 /* |
7e8bd81ce93e
8031743: C2: loadI2L_immI broken for negative memory values
iveresov
parents:
diff
changeset
|
2 * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. |
7e8bd81ce93e
8031743: C2: loadI2L_immI broken for negative memory values
iveresov
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
7e8bd81ce93e
8031743: C2: loadI2L_immI broken for negative memory values
iveresov
parents:
diff
changeset
|
4 * |
7e8bd81ce93e
8031743: C2: loadI2L_immI broken for negative memory values
iveresov
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
7e8bd81ce93e
8031743: C2: loadI2L_immI broken for negative memory values
iveresov
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
7e8bd81ce93e
8031743: C2: loadI2L_immI broken for negative memory values
iveresov
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
7e8bd81ce93e
8031743: C2: loadI2L_immI broken for negative memory values
iveresov
parents:
diff
changeset
|
8 * |
7e8bd81ce93e
8031743: C2: loadI2L_immI broken for negative memory values
iveresov
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
7e8bd81ce93e
8031743: C2: loadI2L_immI broken for negative memory values
iveresov
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
7e8bd81ce93e
8031743: C2: loadI2L_immI broken for negative memory values
iveresov
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
7e8bd81ce93e
8031743: C2: loadI2L_immI broken for negative memory values
iveresov
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
7e8bd81ce93e
8031743: C2: loadI2L_immI broken for negative memory values
iveresov
parents:
diff
changeset
|
13 * accompanied this code). |
7e8bd81ce93e
8031743: C2: loadI2L_immI broken for negative memory values
iveresov
parents:
diff
changeset
|
14 * |
7e8bd81ce93e
8031743: C2: loadI2L_immI broken for negative memory values
iveresov
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
7e8bd81ce93e
8031743: C2: loadI2L_immI broken for negative memory values
iveresov
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
7e8bd81ce93e
8031743: C2: loadI2L_immI broken for negative memory values
iveresov
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
7e8bd81ce93e
8031743: C2: loadI2L_immI broken for negative memory values
iveresov
parents:
diff
changeset
|
18 * |
7e8bd81ce93e
8031743: C2: loadI2L_immI broken for negative memory values
iveresov
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
7e8bd81ce93e
8031743: C2: loadI2L_immI broken for negative memory values
iveresov
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
7e8bd81ce93e
8031743: C2: loadI2L_immI broken for negative memory values
iveresov
parents:
diff
changeset
|
21 * questions. |
7e8bd81ce93e
8031743: C2: loadI2L_immI broken for negative memory values
iveresov
parents:
diff
changeset
|
22 */ |
7e8bd81ce93e
8031743: C2: loadI2L_immI broken for negative memory values
iveresov
parents:
diff
changeset
|
23 |
7e8bd81ce93e
8031743: C2: loadI2L_immI broken for negative memory values
iveresov
parents:
diff
changeset
|
24 /* |
7e8bd81ce93e
8031743: C2: loadI2L_immI broken for negative memory values
iveresov
parents:
diff
changeset
|
25 * @test |
7e8bd81ce93e
8031743: C2: loadI2L_immI broken for negative memory values
iveresov
parents:
diff
changeset
|
26 * @bug 8031743 |
7e8bd81ce93e
8031743: C2: loadI2L_immI broken for negative memory values
iveresov
parents:
diff
changeset
|
27 * @summary loadI2L_immI broken for negative memory values |
7e8bd81ce93e
8031743: C2: loadI2L_immI broken for negative memory values
iveresov
parents:
diff
changeset
|
28 * @run main/othervm -server -Xbatch -XX:-TieredCompilation -XX:CompileCommand=compileonly,*.foo* LoadWithMask2 |
7e8bd81ce93e
8031743: C2: loadI2L_immI broken for negative memory values
iveresov
parents:
diff
changeset
|
29 * |
7e8bd81ce93e
8031743: C2: loadI2L_immI broken for negative memory values
iveresov
parents:
diff
changeset
|
30 */ |
7e8bd81ce93e
8031743: C2: loadI2L_immI broken for negative memory values
iveresov
parents:
diff
changeset
|
31 public class LoadWithMask2 { |
7e8bd81ce93e
8031743: C2: loadI2L_immI broken for negative memory values
iveresov
parents:
diff
changeset
|
32 static int x; |
7e8bd81ce93e
8031743: C2: loadI2L_immI broken for negative memory values
iveresov
parents:
diff
changeset
|
33 static long foo1() { |
7e8bd81ce93e
8031743: C2: loadI2L_immI broken for negative memory values
iveresov
parents:
diff
changeset
|
34 return x & 0xfffffffe; |
7e8bd81ce93e
8031743: C2: loadI2L_immI broken for negative memory values
iveresov
parents:
diff
changeset
|
35 } |
7e8bd81ce93e
8031743: C2: loadI2L_immI broken for negative memory values
iveresov
parents:
diff
changeset
|
36 static long foo2() { |
7e8bd81ce93e
8031743: C2: loadI2L_immI broken for negative memory values
iveresov
parents:
diff
changeset
|
37 return x & 0xff000000; |
7e8bd81ce93e
8031743: C2: loadI2L_immI broken for negative memory values
iveresov
parents:
diff
changeset
|
38 } |
7e8bd81ce93e
8031743: C2: loadI2L_immI broken for negative memory values
iveresov
parents:
diff
changeset
|
39 static long foo3() { |
7e8bd81ce93e
8031743: C2: loadI2L_immI broken for negative memory values
iveresov
parents:
diff
changeset
|
40 return x & 0x8abcdef1; |
7e8bd81ce93e
8031743: C2: loadI2L_immI broken for negative memory values
iveresov
parents:
diff
changeset
|
41 } |
7e8bd81ce93e
8031743: C2: loadI2L_immI broken for negative memory values
iveresov
parents:
diff
changeset
|
42 |
7e8bd81ce93e
8031743: C2: loadI2L_immI broken for negative memory values
iveresov
parents:
diff
changeset
|
43 public static void main(String[] args) { |
7e8bd81ce93e
8031743: C2: loadI2L_immI broken for negative memory values
iveresov
parents:
diff
changeset
|
44 x = -1; |
7e8bd81ce93e
8031743: C2: loadI2L_immI broken for negative memory values
iveresov
parents:
diff
changeset
|
45 long l = 0; |
7e8bd81ce93e
8031743: C2: loadI2L_immI broken for negative memory values
iveresov
parents:
diff
changeset
|
46 for (int i = 0; i < 100000; ++i) { |
7e8bd81ce93e
8031743: C2: loadI2L_immI broken for negative memory values
iveresov
parents:
diff
changeset
|
47 l = foo1() & foo2() & foo3(); |
7e8bd81ce93e
8031743: C2: loadI2L_immI broken for negative memory values
iveresov
parents:
diff
changeset
|
48 } |
7e8bd81ce93e
8031743: C2: loadI2L_immI broken for negative memory values
iveresov
parents:
diff
changeset
|
49 if (l > 0) { |
7e8bd81ce93e
8031743: C2: loadI2L_immI broken for negative memory values
iveresov
parents:
diff
changeset
|
50 System.out.println("FAILED"); |
7e8bd81ce93e
8031743: C2: loadI2L_immI broken for negative memory values
iveresov
parents:
diff
changeset
|
51 System.exit(97); |
7e8bd81ce93e
8031743: C2: loadI2L_immI broken for negative memory values
iveresov
parents:
diff
changeset
|
52 } |
7e8bd81ce93e
8031743: C2: loadI2L_immI broken for negative memory values
iveresov
parents:
diff
changeset
|
53 System.out.println("PASSED"); |
7e8bd81ce93e
8031743: C2: loadI2L_immI broken for negative memory values
iveresov
parents:
diff
changeset
|
54 } |
7e8bd81ce93e
8031743: C2: loadI2L_immI broken for negative memory values
iveresov
parents:
diff
changeset
|
55 } |