Mads Ager | 418d1ca | 2017-05-22 09:35:49 +0200 | [diff] [blame] | 1 | // Copyright (c) 2017, the R8 project authors. Please see the AUTHORS file |
| 2 | // for details. All rights reserved. Use of this source code is governed by a |
| 3 | // BSD-style license that can be found in the LICENSE file. |
| 4 | package floating_point_annotations; |
| 5 | |
| 6 | public class FloatingPointValuedAnnotationTest { |
| 7 | |
| 8 | @FloatingPointValuedAnnotation(doubleValue = -0d) |
| 9 | class A { |
| 10 | } |
| 11 | |
| 12 | @FloatingPointValuedAnnotation(doubleValue = 0d) |
| 13 | class B { |
| 14 | } |
| 15 | |
| 16 | @FloatingPointValuedAnnotation(floatValue = -0f) |
| 17 | class C { |
| 18 | } |
| 19 | |
| 20 | @FloatingPointValuedAnnotation(floatValue = 0f) |
| 21 | class D { |
| 22 | } |
| 23 | |
| 24 | public static void main(String[] args) { |
| 25 | System.out.println(A.class.getAnnotation(FloatingPointValuedAnnotation.class) |
| 26 | .equals(B.class.getAnnotation(FloatingPointValuedAnnotation.class))); |
| 27 | |
| 28 | System.out.println(C.class.getAnnotation(FloatingPointValuedAnnotation.class) |
| 29 | .equals(D.class.getAnnotation(FloatingPointValuedAnnotation.class))); |
| 30 | } |
| 31 | } |