summaryrefslogtreecommitdiffstats
path: root/jack-tests
diff options
context:
space:
mode:
authorYohann Roussel <yroussel@google.com>2014-09-12 15:36:42 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-09-12 15:36:42 +0000
commit63f38a100ed9b9c14788a87b8788ee95c564fd04 (patch)
tree74bdac14829b750014c6d2bdf177d80e05d42c1b /jack-tests
parent388d0edee050e397995eb3b8df18bb500d23d349 (diff)
parent9358069150db09acbfd16f32eb536b2a8d81c729 (diff)
downloadtoolchain_jack-63f38a100ed9b9c14788a87b8788ee95c564fd04.zip
toolchain_jack-63f38a100ed9b9c14788a87b8788ee95c564fd04.tar.gz
toolchain_jack-63f38a100ed9b9c14788a87b8788ee95c564fd04.tar.bz2
Merge "Fix number literal conversion in array initializers" into ub-jack
Diffstat (limited to 'jack-tests')
-rw-r--r--jack-tests/tests/com/android/jack/cast/implicit006/jack/Implicit006.java58
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};
+ }
+
+}