David Brazdil | 5cc343d | 2015-10-08 11:35:32 +0100 | [diff] [blame] | 1 | # Copyright (C) 2015 The Android Open Source Project |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
| 15 | .class public LTestCase; |
| 16 | |
| 17 | .super Ljava/lang/Object; |
| 18 | |
| 19 | # The phi in this method has no actual uses but one environment use. It will |
| 20 | # be eliminated in normal mode but kept live in debuggable mode. Test that |
| 21 | # Checker runs the correct test for each compilation mode. |
| 22 | |
David Brazdil | badd826 | 2016-02-02 16:28:56 +0000 | [diff] [blame] | 23 | ## CHECK-START: int TestCase.deadPhi(int, int, int) builder (after) |
David Brazdil | 5cc343d | 2015-10-08 11:35:32 +0100 | [diff] [blame] | 24 | ## CHECK-NOT: Phi |
| 25 | |
David Brazdil | badd826 | 2016-02-02 16:28:56 +0000 | [diff] [blame] | 26 | ## CHECK-START-DEBUGGABLE: int TestCase.deadPhi(int, int, int) builder (after) |
David Brazdil | 5cc343d | 2015-10-08 11:35:32 +0100 | [diff] [blame] | 27 | ## CHECK: Phi |
| 28 | |
| 29 | .method public static deadPhi(III)I |
| 30 | .registers 8 |
| 31 | |
| 32 | move v0, p1 |
| 33 | if-eqz p0, :after |
| 34 | move v0, p2 |
| 35 | :after |
| 36 | # v0 = Phi [p1, p2] with no uses |
| 37 | |
| 38 | invoke-static {}, Ljava/lang/System;->nanoTime()J # create an env use |
| 39 | |
| 40 | :return |
| 41 | return p2 |
| 42 | .end method |