Path: blob/master/test/hotspot/jtreg/compiler/loopstripmining/TestLoadOnBackedgeWithPrec.java
41152 views
/*1* Copyright (c) 2021, Red Hat, Inc. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*/2223/**24* @test25* @bug 826436026* @summary Loop strip mining verification fails with "should be on the backedge"27*28* @run main/othervm -XX:-TieredCompilation -XX:-BackgroundCompilation TestLoadOnBackedgeWithPrec29*30*/313233class a {34int g = 20;35float h = 2;36long b = 6;37}3839public class TestLoadOnBackedgeWithPrec {40int c ;41a[] i = {new a()};42float j() {43a k = new a();44float l = 5;45for (int d = 0; d < 8; ++d) {46for (int e = 0; e < 9; ++e) {47k = k;48l *= k.g;49}50for (int f = 0; f < 9; ++f) {51new a();52}53{54a[] m = {55new a(), new a(), new a(),56new a(), new a(), new a(),57new a(), new a(), new a()};58c = i[0].g + k.g;59}60}61return k.h;62}63public static void main(String[] args) {64TestLoadOnBackedgeWithPrec n = new TestLoadOnBackedgeWithPrec();65for (int i = 0; i < 5_000; i++) {66n.j();67}68}69}70717273