1#
2# Copyright (C) 2021 The Android Open Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8#     http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16.class public LBadFieldGet;
17.super Ljava/lang/Object;
18
19# These are bad fields since there is no class Widget in this test.
20.field public static widget:LWidget;
21
22.method public constructor <init>()V
23    .registers 2
24    invoke-direct {v1}, Ljava/lang/Object;-><init>()V
25    return-void
26.end method
27
28.method public static loadStatic()Ljava/lang/Object;
29    .registers 1
30    # Put an object in the register used for sget-object, the bug in mterp checked it was
31    # non-null.
32    new-instance v0, LBadFieldGet;
33    invoke-direct {v0}, LBadFieldGet;-><init>()V
34    sget-object v0, LBadField;->widget:LWidget;
35    return-object v0
36.end method
37
38.method public static forceAccessChecks()V
39    .registers 0
40    invoke-static {}, LMain;->privateMethod()V
41    return-void
42.end method
43