hotspot/test/compiler/codegen/6875866/Test.java
author zmajo
Tue, 18 Nov 2014 19:44:45 +0100
changeset 27699 9913b19c0948
parent 5547 hotspot/test/compiler/6875866/Test.java@f4b087cbb361
permissions -rw-r--r--
8062854: move compiler jtreg test to corresponding subfolders and use those in TEST.groups Summary: move all test from <bug_id> directories to <functional_dir_name>/<bug_id>; update TEST.groups to execute more tests Reviewed-by: drchase, kvn
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3905
7d725029ac85 6827605: new String intrinsics may prevent EA scalar replacement
kvn
parents:
diff changeset
     1
/*
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 3905
diff changeset
     2
 * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
3905
7d725029ac85 6827605: new String intrinsics may prevent EA scalar replacement
kvn
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
7d725029ac85 6827605: new String intrinsics may prevent EA scalar replacement
kvn
parents:
diff changeset
     4
 *
7d725029ac85 6827605: new String intrinsics may prevent EA scalar replacement
kvn
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
7d725029ac85 6827605: new String intrinsics may prevent EA scalar replacement
kvn
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
7d725029ac85 6827605: new String intrinsics may prevent EA scalar replacement
kvn
parents:
diff changeset
     7
 * published by the Free Software Foundation.
7d725029ac85 6827605: new String intrinsics may prevent EA scalar replacement
kvn
parents:
diff changeset
     8
 *
7d725029ac85 6827605: new String intrinsics may prevent EA scalar replacement
kvn
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
7d725029ac85 6827605: new String intrinsics may prevent EA scalar replacement
kvn
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
7d725029ac85 6827605: new String intrinsics may prevent EA scalar replacement
kvn
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
7d725029ac85 6827605: new String intrinsics may prevent EA scalar replacement
kvn
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
7d725029ac85 6827605: new String intrinsics may prevent EA scalar replacement
kvn
parents:
diff changeset
    13
 * accompanied this code).
7d725029ac85 6827605: new String intrinsics may prevent EA scalar replacement
kvn
parents:
diff changeset
    14
 *
7d725029ac85 6827605: new String intrinsics may prevent EA scalar replacement
kvn
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
7d725029ac85 6827605: new String intrinsics may prevent EA scalar replacement
kvn
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
7d725029ac85 6827605: new String intrinsics may prevent EA scalar replacement
kvn
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
7d725029ac85 6827605: new String intrinsics may prevent EA scalar replacement
kvn
parents:
diff changeset
    18
 *
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 3905
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 3905
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 3905
diff changeset
    21
 * questions.
3905
7d725029ac85 6827605: new String intrinsics may prevent EA scalar replacement
kvn
parents:
diff changeset
    22
 */
7d725029ac85 6827605: new String intrinsics may prevent EA scalar replacement
kvn
parents:
diff changeset
    23
7d725029ac85 6827605: new String intrinsics may prevent EA scalar replacement
kvn
parents:
diff changeset
    24
/**
7d725029ac85 6827605: new String intrinsics may prevent EA scalar replacement
kvn
parents:
diff changeset
    25
 * @test
7d725029ac85 6827605: new String intrinsics may prevent EA scalar replacement
kvn
parents:
diff changeset
    26
 * @bug 6875866
7d725029ac85 6827605: new String intrinsics may prevent EA scalar replacement
kvn
parents:
diff changeset
    27
 * @summary Intrinsic for String.indexOf() is broken on x86 with SSE4.2
7d725029ac85 6827605: new String intrinsics may prevent EA scalar replacement
kvn
parents:
diff changeset
    28
 *
7d725029ac85 6827605: new String intrinsics may prevent EA scalar replacement
kvn
parents:
diff changeset
    29
 * @run main/othervm -Xcomp Test
7d725029ac85 6827605: new String intrinsics may prevent EA scalar replacement
kvn
parents:
diff changeset
    30
 */
7d725029ac85 6827605: new String intrinsics may prevent EA scalar replacement
kvn
parents:
diff changeset
    31
7d725029ac85 6827605: new String intrinsics may prevent EA scalar replacement
kvn
parents:
diff changeset
    32
public class Test {
7d725029ac85 6827605: new String intrinsics may prevent EA scalar replacement
kvn
parents:
diff changeset
    33
7d725029ac85 6827605: new String intrinsics may prevent EA scalar replacement
kvn
parents:
diff changeset
    34
  static int IndexOfTest(String str) {
7d725029ac85 6827605: new String intrinsics may prevent EA scalar replacement
kvn
parents:
diff changeset
    35
    return str.indexOf("11111xx1x");
7d725029ac85 6827605: new String intrinsics may prevent EA scalar replacement
kvn
parents:
diff changeset
    36
  }
7d725029ac85 6827605: new String intrinsics may prevent EA scalar replacement
kvn
parents:
diff changeset
    37
7d725029ac85 6827605: new String intrinsics may prevent EA scalar replacement
kvn
parents:
diff changeset
    38
  public static void main(String args[]) {
7d725029ac85 6827605: new String intrinsics may prevent EA scalar replacement
kvn
parents:
diff changeset
    39
    String str = "11111xx11111xx1x";
7d725029ac85 6827605: new String intrinsics may prevent EA scalar replacement
kvn
parents:
diff changeset
    40
    int idx = IndexOfTest(str);
7d725029ac85 6827605: new String intrinsics may prevent EA scalar replacement
kvn
parents:
diff changeset
    41
    System.out.println("IndexOf = " + idx);
7d725029ac85 6827605: new String intrinsics may prevent EA scalar replacement
kvn
parents:
diff changeset
    42
    if (idx != 7) {
7d725029ac85 6827605: new String intrinsics may prevent EA scalar replacement
kvn
parents:
diff changeset
    43
      System.exit(97);
7d725029ac85 6827605: new String intrinsics may prevent EA scalar replacement
kvn
parents:
diff changeset
    44
    }
7d725029ac85 6827605: new String intrinsics may prevent EA scalar replacement
kvn
parents:
diff changeset
    45
  }
7d725029ac85 6827605: new String intrinsics may prevent EA scalar replacement
kvn
parents:
diff changeset
    46
}