• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 assumenosideeffects4;
5 
6 public class Assumenosideeffects {
7 
8   public static final int ASSUMED_VALUE_0 = 0;
9   public static final int ASSUMED_VALUE_1 = 1;
10   public static final long ASSUMED_VALUE_0L = 0;
11   public static final long ASSUMED_VALUE_1L = 1;
12 
main(String[] args)13   public static void main(String[] args) {
14     System.out.println(method0());
15     System.out.println(method1());
16     System.out.println(method0L() + "L");
17     System.out.println(method1L() + "L");
18   }
19 
20   @CheckDiscarded
method0()21   public static int method0() {
22     System.out.println("method0");
23     return ASSUMED_VALUE_0;
24   }
25 
26   @CheckDiscarded
method1()27   public static int method1() {
28     System.out.println("method1");
29     return ASSUMED_VALUE_1;
30   }
31 
32   @CheckDiscarded
method0L()33   public static long method0L() {
34     System.out.println("method0L");
35     return ASSUMED_VALUE_0L;
36   }
37 
38   @CheckDiscarded
method1L()39   public static long method1L() {
40     System.out.println("method1L");
41     return ASSUMED_VALUE_1L;
42   }
43 }
44