< prev index next > test/hotspot/jtreg/compiler/c2/TestBit.java
Print this page
/*
! * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
/*
! * Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
* @bug 8247408
* @summary C2 should convert ((var&16) == 16) to ((var&16) != 0) for power-of-two constants
* @library /test/lib /
*
* @requires vm.flagless
! * @requires os.arch=="aarch64" | os.arch=="amd64" | os.arch == "ppc64le"
* @requires vm.debug == true & vm.compiler2.enabled
*
* @run driver compiler.c2.TestBit
*/
public class TestBit {
* @bug 8247408
* @summary C2 should convert ((var&16) == 16) to ((var&16) != 0) for power-of-two constants
* @library /test/lib /
*
* @requires vm.flagless
! * @requires os.arch=="aarch64" | os.arch=="amd64" | os.arch == "ppc64le" | os.arch == "riscv64"
* @requires vm.debug == true & vm.compiler2.enabled
*
* @run driver compiler.c2.TestBit
*/
public class TestBit {
OutputAnalyzer output = new OutputAnalyzer(pb.start());
String expectedTestBitInstruction =
"ppc64le".equals(System.getProperty("os.arch")) ? "ANDI" :
"aarch64".equals(System.getProperty("os.arch")) ? "tb" :
! "amd64".equals(System.getProperty("os.arch")) ? "test" : null;
if (expectedTestBitInstruction != null) {
output.shouldContain(expectedTestBitInstruction);
} else {
System.err.println("unexpected os.arch");
OutputAnalyzer output = new OutputAnalyzer(pb.start());
String expectedTestBitInstruction =
"ppc64le".equals(System.getProperty("os.arch")) ? "ANDI" :
"aarch64".equals(System.getProperty("os.arch")) ? "tb" :
! "amd64".equals(System.getProperty("os.arch")) ? "test" :
+ "riscv64".equals(System.getProperty("os.arch")) ? "andi" : null;
if (expectedTestBitInstruction != null) {
output.shouldContain(expectedTestBitInstruction);
} else {
System.err.println("unexpected os.arch");
< prev index next >