diff options
author | Serguei Katkov <serguei.i.katkov@intel.com> | 2015-04-20 14:22:27 +0600 |
---|---|---|
committer | Nicolas Geoffray <ngeoffray@google.com> | 2015-04-23 12:53:47 +0100 |
commit | 538491967d1514a263e99d78379d743fcc896eef (patch) | |
tree | f07290c03789f7b1d7851bc94ebe77b8060eb9a0 /test/475-simplify-mul-zero | |
parent | 9d4d13f38398e880e610323242fe73d609bac40d (diff) | |
download | art-538491967d1514a263e99d78379d743fcc896eef.zip art-538491967d1514a263e99d78379d743fcc896eef.tar.gz art-538491967d1514a263e99d78379d743fcc896eef.tar.bz2 |
Mul simplification should expect zero operand
It is possible that zero constant can appear due to
simplification of other instructions, so we cannot expect
zero handling from constant optimizations.
Change-Id: I084126fd0c106ac2683c4f10a451960d9807f4f6
Signed-off-by: Serguei Katkov <serguei.i.katkov@intel.com>
Diffstat (limited to 'test/475-simplify-mul-zero')
-rw-r--r-- | test/475-simplify-mul-zero/expected.txt | 1 | ||||
-rw-r--r-- | test/475-simplify-mul-zero/info.txt | 2 | ||||
-rw-r--r-- | test/475-simplify-mul-zero/src/Main.java | 28 |
3 files changed, 31 insertions, 0 deletions
diff --git a/test/475-simplify-mul-zero/expected.txt b/test/475-simplify-mul-zero/expected.txt new file mode 100644 index 0000000..7ed6ff8 --- /dev/null +++ b/test/475-simplify-mul-zero/expected.txt @@ -0,0 +1 @@ +5 diff --git a/test/475-simplify-mul-zero/info.txt b/test/475-simplify-mul-zero/info.txt new file mode 100644 index 0000000..0db11f2 --- /dev/null +++ b/test/475-simplify-mul-zero/info.txt @@ -0,0 +1,2 @@ +Regression check for optimizing simplify instruction pass. +Mul should expect zero constant as input.
\ No newline at end of file diff --git a/test/475-simplify-mul-zero/src/Main.java b/test/475-simplify-mul-zero/src/Main.java new file mode 100644 index 0000000..57adcff --- /dev/null +++ b/test/475-simplify-mul-zero/src/Main.java @@ -0,0 +1,28 @@ +/* + * 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) { + long l3 = 2207693990L; + int i12 = 5; + + for (int i = 1; i < 2; ++i) { + i12 ^= (int)(-((-(-(l3 - l3))) * i)); + } + + System.out.println(i12); + } +} |