diff options
author | Yohann Roussel <yroussel@google.com> | 2014-09-11 13:58:32 +0200 |
---|---|---|
committer | Yohann Roussel <yroussel@google.com> | 2014-09-12 16:26:55 +0200 |
commit | 9358069150db09acbfd16f32eb536b2a8d81c729 (patch) | |
tree | 7b0e0eb6ac6fbb4a11ca2eb1bd921f4e608a48ed /jack-tests/tests | |
parent | 521e38161b2a1e17381b266913e5c53df616b945 (diff) | |
download | toolchain_jack-9358069150db09acbfd16f32eb536b2a8d81c729.zip toolchain_jack-9358069150db09acbfd16f32eb536b2a8d81c729.tar.gz toolchain_jack-9358069150db09acbfd16f32eb536b2a8d81c729.tar.bz2 |
Fix number literal conversion in array initializers
Change-Id: I6bcf8a270c45fbb9c06cf062742c75694817fdb4
Diffstat (limited to 'jack-tests/tests')
-rw-r--r-- | jack-tests/tests/com/android/jack/cast/implicit006/jack/Implicit006.java | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/jack-tests/tests/com/android/jack/cast/implicit006/jack/Implicit006.java b/jack-tests/tests/com/android/jack/cast/implicit006/jack/Implicit006.java new file mode 100644 index 0000000..7a2d59c --- /dev/null +++ b/jack-tests/tests/com/android/jack/cast/implicit006/jack/Implicit006.java @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.cast.implicit006.jack; + +public class Implicit006 { + + private static final byte byteValue = 127; + + private static final short shortValue = 315; + + private static final char charValue = 't'; + + private static final int intValue = 1650000; + + private static final long longValue = 0x123456789L; + + private static final float floatValue = 31.55F; + + private static final double doubleValue = 31.55D; + + public byte[] getByteArray() { + return new byte[]{byteValue}; + } + public char[] getCharArray() { + return new char[]{byteValue, shortValue, charValue}; + } + public short[] getShortArray() { + return new short[]{byteValue, shortValue, charValue}; + } + public int[] getIntArray() { + return new int[]{byteValue, shortValue, charValue, intValue}; + } + public long[] getLongArray() { + return new long[]{byteValue, shortValue, charValue, intValue, longValue}; + } + public float[] getFloatArray() { + return new float[]{byteValue, shortValue, charValue, intValue, longValue, floatValue}; + } + public double[] getDoubleArray() { + return new double[]{byteValue, shortValue, charValue, intValue, longValue, floatValue, + doubleValue}; + } + +} |