Mercurial > hg > graal-compiler
annotate graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/CompilerErrorTest.java @ 17179:6d8ae4c6725f
[SPARC] UseCompressedOops defaulting to false on SPARC && GRAAL
author | Stefan Anzinger <stefan.anzinger@oracle.com> |
---|---|
date | Mon, 22 Sep 2014 11:20:35 -0700 |
parents | 43eab069ca9b |
children |
rev | line source |
---|---|
11466
4830676526e3
Truffle-DSL: added infrastructure to assert for DSL error messages.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
1 /* |
4830676526e3
Truffle-DSL: added infrastructure to assert for DSL error messages.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
2 * Copyright (c) 2012, 2012, Oracle and/or its affiliates. All rights reserved. |
4830676526e3
Truffle-DSL: added infrastructure to assert for DSL error messages.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4830676526e3
Truffle-DSL: added infrastructure to assert for DSL error messages.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
4 * |
4830676526e3
Truffle-DSL: added infrastructure to assert for DSL error messages.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
4830676526e3
Truffle-DSL: added infrastructure to assert for DSL error messages.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
4830676526e3
Truffle-DSL: added infrastructure to assert for DSL error messages.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
4830676526e3
Truffle-DSL: added infrastructure to assert for DSL error messages.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
8 * |
4830676526e3
Truffle-DSL: added infrastructure to assert for DSL error messages.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
4830676526e3
Truffle-DSL: added infrastructure to assert for DSL error messages.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
4830676526e3
Truffle-DSL: added infrastructure to assert for DSL error messages.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
4830676526e3
Truffle-DSL: added infrastructure to assert for DSL error messages.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
4830676526e3
Truffle-DSL: added infrastructure to assert for DSL error messages.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
13 * accompanied this code). |
4830676526e3
Truffle-DSL: added infrastructure to assert for DSL error messages.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
14 * |
4830676526e3
Truffle-DSL: added infrastructure to assert for DSL error messages.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
4830676526e3
Truffle-DSL: added infrastructure to assert for DSL error messages.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
4830676526e3
Truffle-DSL: added infrastructure to assert for DSL error messages.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
4830676526e3
Truffle-DSL: added infrastructure to assert for DSL error messages.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
18 * |
4830676526e3
Truffle-DSL: added infrastructure to assert for DSL error messages.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
4830676526e3
Truffle-DSL: added infrastructure to assert for DSL error messages.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
4830676526e3
Truffle-DSL: added infrastructure to assert for DSL error messages.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
21 * questions. |
4830676526e3
Truffle-DSL: added infrastructure to assert for DSL error messages.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
22 */ |
4830676526e3
Truffle-DSL: added infrastructure to assert for DSL error messages.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
23 package com.oracle.truffle.api.dsl.test; |
4830676526e3
Truffle-DSL: added infrastructure to assert for DSL error messages.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
24 |
4830676526e3
Truffle-DSL: added infrastructure to assert for DSL error messages.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
25 import com.oracle.truffle.api.dsl.*; |
4830676526e3
Truffle-DSL: added infrastructure to assert for DSL error messages.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
26 import com.oracle.truffle.api.dsl.test.TypeSystemTest.ValueNode; |
4830676526e3
Truffle-DSL: added infrastructure to assert for DSL error messages.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
27 |
4830676526e3
Truffle-DSL: added infrastructure to assert for DSL error messages.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
28 public class CompilerErrorTest { |
4830676526e3
Truffle-DSL: added infrastructure to assert for DSL error messages.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
29 |
4830676526e3
Truffle-DSL: added infrastructure to assert for DSL error messages.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
30 abstract static class Visiblity01 extends ValueNode { |
4830676526e3
Truffle-DSL: added infrastructure to assert for DSL error messages.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
31 |
4830676526e3
Truffle-DSL: added infrastructure to assert for DSL error messages.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
32 @Specialization |
4830676526e3
Truffle-DSL: added infrastructure to assert for DSL error messages.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
33 @SuppressWarnings("static-method") |
4830676526e3
Truffle-DSL: added infrastructure to assert for DSL error messages.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
34 @ExpectError("Method annotated with @Specialization must not be private.") |
4830676526e3
Truffle-DSL: added infrastructure to assert for DSL error messages.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
35 private Object s() { |
4830676526e3
Truffle-DSL: added infrastructure to assert for DSL error messages.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
36 return null; |
4830676526e3
Truffle-DSL: added infrastructure to assert for DSL error messages.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
37 } |
4830676526e3
Truffle-DSL: added infrastructure to assert for DSL error messages.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
38 |
4830676526e3
Truffle-DSL: added infrastructure to assert for DSL error messages.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
39 } |
4830676526e3
Truffle-DSL: added infrastructure to assert for DSL error messages.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
40 |
11467
43eab069ca9b
Truffle-DSL: improved error recovery of type systems and improved error testability infrastructure.
Christian Humer <christian.humer@gmail.com>
parents:
11466
diff
changeset
|
41 @ExpectError("Classes containing a @Specialization annotation must not be private.") |
11466
4830676526e3
Truffle-DSL: added infrastructure to assert for DSL error messages.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
42 private abstract static class Visiblity02 extends ValueNode { |
4830676526e3
Truffle-DSL: added infrastructure to assert for DSL error messages.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
43 |
4830676526e3
Truffle-DSL: added infrastructure to assert for DSL error messages.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
44 @Specialization |
4830676526e3
Truffle-DSL: added infrastructure to assert for DSL error messages.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
45 public Object s() { |
4830676526e3
Truffle-DSL: added infrastructure to assert for DSL error messages.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
46 return null; |
4830676526e3
Truffle-DSL: added infrastructure to assert for DSL error messages.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
47 } |
4830676526e3
Truffle-DSL: added infrastructure to assert for DSL error messages.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
48 |
4830676526e3
Truffle-DSL: added infrastructure to assert for DSL error messages.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
49 } |
4830676526e3
Truffle-DSL: added infrastructure to assert for DSL error messages.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
50 |
4830676526e3
Truffle-DSL: added infrastructure to assert for DSL error messages.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
51 // assert no error |
4830676526e3
Truffle-DSL: added infrastructure to assert for DSL error messages.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
52 @ExpectError({}) |
4830676526e3
Truffle-DSL: added infrastructure to assert for DSL error messages.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
53 private abstract static class Visiblity03 extends ValueNode { |
4830676526e3
Truffle-DSL: added infrastructure to assert for DSL error messages.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
54 |
4830676526e3
Truffle-DSL: added infrastructure to assert for DSL error messages.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
55 } |
4830676526e3
Truffle-DSL: added infrastructure to assert for DSL error messages.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
56 |
4830676526e3
Truffle-DSL: added infrastructure to assert for DSL error messages.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
57 } |