blob: 1e1df87582f892ec18d18862d6295dc161d025cd [file] [log] [blame]
Nicolas Geoffray234d69d2015-03-09 10:28:50 +00001/*
2 * Copyright (C) 2015 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17public class Main {
18 public static void main(String[] args) {
Roland Levillain3c829a32015-06-02 17:05:20 +010019 System.out.println($noinline$FloatConvert(false));
20 System.out.println($noinline$DoubleConvert(false));
Nicolas Geoffray234d69d2015-03-09 10:28:50 +000021 }
22
Roland Levillain3c829a32015-06-02 17:05:20 +010023 public static long $noinline$FloatConvert(boolean flag) {
Nicolas Geoffray234d69d2015-03-09 10:28:50 +000024 long l = myLong;
25 myFloat = (float)l;
26 return l;
27 }
28
Roland Levillain3c829a32015-06-02 17:05:20 +010029 public static long $noinline$DoubleConvert(boolean flag) {
Nicolas Geoffray234d69d2015-03-09 10:28:50 +000030 long l = myLong;
Roland Levillain3c829a32015-06-02 17:05:20 +010031 myDouble = (double)l;
Nicolas Geoffray234d69d2015-03-09 10:28:50 +000032 return l;
33 }
34
35 public static long myLong = 42;
36 public static float myFloat = 2.0f;
37 public static double myDouble = 4.0d;
38}