2259N/A/*
2259N/A * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
2259N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2259N/A *
2259N/A * This code is free software; you can redistribute it and/or modify it
2259N/A * under the terms of the GNU General Public License version 2 only, as
2259N/A * published by the Free Software Foundation.
2259N/A *
2259N/A * This code is distributed in the hope that it will be useful, but WITHOUT
2259N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
2259N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
2259N/A * version 2 for more details (a copy is included in the LICENSE file that
2259N/A * accompanied this code).
2259N/A *
2259N/A * You should have received a copy of the GNU General Public License version
2259N/A * 2 along with this work; if not, write to the Free Software Foundation,
2259N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
2259N/A *
2259N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2259N/A * or visit www.oracle.com if you need additional information or have any
2259N/A * questions.
2259N/A */
2259N/A
2259N/A/**
2259N/A * @test
2259N/A * @bug 7029152
2259N/A * @summary Ideal nodes for String intrinsics miss memory edge optimization
2259N/A *
2259N/A * @run main/othervm -Xbatch Test
2259N/A */
2259N/A
2259N/Apublic class Test {
2259N/A
2259N/A static final String str = "11111xx11111xx1x";
2259N/A static int idx = 0;
2259N/A
2259N/A static int IndexOfTest(String str) {
2259N/A return str.indexOf("11111xx1x");
2259N/A }
2259N/A
2259N/A public static void main(String args[]) {
2259N/A final int ITERS=2000000;
2259N/A
2259N/A for (int i=0; i<ITERS; i++) {
2259N/A idx = IndexOfTest(str);
2259N/A }
2259N/A System.out.println("IndexOf = " + idx);
2259N/A }
2259N/A}