Path: blob/master/test/hotspot/jtreg/compiler/c1/TestLinearScanHasFPURegisters.java
64474 views
/*1* Copyright (c) 2021, Oracle and/or its affiliates. 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 826836626* @run main/othervm -Xbatch -XX:+TieredCompilation -XX:TieredStopAtLevel=127* compiler.c1.TestLinearScanHasFPURegisters28*/2930package compiler.c1;3132public class TestLinearScanHasFPURegisters {33void test(String[] args) {34String arr[] = new String[4];35float f = -1;36try {37arr[0] = "-1"; // exception edge 1 with value -138if (args.length > 1) {39f = 42;40arr[1] = "42"; // exception edge 2 with value 4241}42} catch (Exception e) {43// exception handler block with incoming phi for "f"44for (int i = 0; i < 1; ++i) {45f = f; // generates bytecodes, but no JIT IR46}47}48}49public static void main(String[] args) {50TestLinearScanHasFPURegisters t = new TestLinearScanHasFPURegisters();51for (int i = 0; i < 1000; ++i) {52t.test(args);53}54}55}565758