diff options
author | Nicolas Geoffray <ngeoffray@google.com> | 2015-04-30 11:16:06 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-04-30 11:16:06 +0000 |
commit | fd5f56d4604eeeacdf6be5189187b6ef49157280 (patch) | |
tree | b53a3ba3a8a4978e372a4e9a657b2c4c5ace7648 /test | |
parent | 56784f887bad1219f326e9e6d110f785f31a5968 (diff) | |
parent | 2af2307f3903a75a379029c049b86f9903fc81a5 (diff) | |
download | art-fd5f56d4604eeeacdf6be5189187b6ef49157280.zip art-fd5f56d4604eeeacdf6be5189187b6ef49157280.tar.gz art-fd5f56d4604eeeacdf6be5189187b6ef49157280.tar.bz2 |
Merge "Revert "GVN final fields even with side effects.""
Diffstat (limited to 'test')
-rw-r--r-- | test/483-checker-gvn/expected.txt | 0 | ||||
-rw-r--r-- | test/483-checker-gvn/info.txt | 1 | ||||
-rw-r--r-- | test/483-checker-gvn/src/Main.java | 62 |
3 files changed, 0 insertions, 63 deletions
diff --git a/test/483-checker-gvn/expected.txt b/test/483-checker-gvn/expected.txt deleted file mode 100644 index e69de29..0000000 --- a/test/483-checker-gvn/expected.txt +++ /dev/null diff --git a/test/483-checker-gvn/info.txt b/test/483-checker-gvn/info.txt deleted file mode 100644 index 3ff7a8c..0000000 --- a/test/483-checker-gvn/info.txt +++ /dev/null @@ -1 +0,0 @@ -Tests that final fields can be GVNed even with side effects. diff --git a/test/483-checker-gvn/src/Main.java b/test/483-checker-gvn/src/Main.java deleted file mode 100644 index ed474aa..0000000 --- a/test/483-checker-gvn/src/Main.java +++ /dev/null @@ -1,62 +0,0 @@ -/* -* 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 final int staticField; - public final int instanceField; - - Main() { - instanceField = 42; - } - - static { - staticField = 42; - } - - // CHECK-START: int Main.addStatic() GVN (before) - // CHECK-DAG: StaticFieldGet - // CHECK-DAG: StaticFieldGet - - // CHECK-START: int Main.addStatic() GVN (after) - // CHECK-DAG: StaticFieldGet - // CHECK-NOT: StaticFieldGet - public static int addStatic() { - return staticField + doACall() + staticField; - } - - // CHECK-START: int Main.addInstance() GVN (before) - // CHECK-DAG: InstanceFieldGet - // CHECK-DAG: InstanceFieldGet - - // CHECK-START: int Main.addInstance() GVN (after) - // CHECK-DAG: InstanceFieldGet - // CHECK-NOT: InstanceFieldGet - public int addInstance() { - return instanceField + doACall() + instanceField; - } - - public static int doACall() { - try { - // Defeat inlining. - Thread.sleep(0); - } catch (Throwable t ) {} - return (int) System.currentTimeMillis(); - } - - public static void main(String[] args) { - } -} |