• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2016, 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 
5 // This code is not run directly. It needs to be compiled to dex code.
6 // 'arithmetic.dex' is what is run.
7 
8 package regress;
9 
10 public class Regress {
11 
b33336471_int_float()12   static void b33336471_int_float() {
13     int i = 0;
14     float f0 = 0.0f;
15     float f1 = 1.0f;
16     for (int j = i; j < 2; j++) {
17       System.out.println("LOOP");
18     }
19     float f[] = new float[1];
20     if (f[0] != f0) {
21       System.out.println("FLOAT COMPARISON FAILED");
22     }
23     if (f[0] == f1) {
24       System.out.println("FLOAT COMPARISON FAILED");
25     }
26   }
27 
b33336471_long_double()28   static void b33336471_long_double() {
29     long i = 0;
30     double d0 = 0.0f;
31     double d1 = 1.0f;
32     for (long j = i; j < 2; j++) {
33       System.out.println("LOOP");
34     }
35     double d[] = new double[1];
36     if (d[0] != d0) {
37       System.out.println("DOUBLE COMPARISON FAILED");
38     }
39     if (d[0] == d1) {
40       System.out.println("DOUBLE COMPARISON FAILED");
41     }
42   }
43 
main(String[] args)44   public static void main(String[] args) {
45     b33336471_int_float();
46     b33336471_long_double();
47   }
48 }
49