summaryrefslogtreecommitdiff
path: root/test/560-packed-switch/src/Main.java
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2015-12-30 14:10:13 +0000
committer Nicolas Geoffray <ngeoffray@google.com> 2015-12-30 14:22:11 +0000
commit6ce017304099d1df97ffa016ce0efce79c67f344 (patch)
tree6c8265acb94f17e78371191809fe67d8101c2c4e /test/560-packed-switch/src/Main.java
parente38e4b467bdcca1bf5f8b80adc66d3064fa9cf45 (diff)
On x64, cmpl can never take a int64 immediate.
Fix a wrong type widening in x64 code generator and add CHECKs in the assembler. Change-Id: Id35f5d47c6cf78ed07e73ab783db09712d3c437f
Diffstat (limited to 'test/560-packed-switch/src/Main.java')
-rw-r--r--test/560-packed-switch/src/Main.java31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/560-packed-switch/src/Main.java b/test/560-packed-switch/src/Main.java
new file mode 100644
index 0000000000..3b0b425c86
--- /dev/null
+++ b/test/560-packed-switch/src/Main.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2015 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.
+ */
+
+public class Main {
+ public static void main(String[] args) {
+ switch (staticField) {
+ case -1:
+ return;
+ case -4:
+ // We add this case to make it an odd number of case/default.
+ // The code generation for it used to be bogus.
+ throw new Error("Cannot happen");
+ default:
+ throw new Error("Cannot happen");
+ }
+ }
+ static int staticField = -1;
+}