Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/test/aarch64/DoubleCmpTests.java
32282 views
1public class DoubleCmpTests {23private static boolean test_isEq(double a, double b) {4return a == b;5}67private static boolean test_isNe(double a, double b) {8return a != b;9}1011private static boolean test_isLt(double a, double b) {12return a < b;13}1415private static boolean test_isLe(double a, double b) {16return a <= b;17}1819private static boolean test_isGe(double a, double b) {20return a >= b;21}2223private static boolean test_isGt(double a, double b) {24return a > b;25}2627private static boolean test_isEqC(double a) {28return a == 7.;29}3031private static boolean test_isNeC(double a) {32return a != 7.;33}3435private static boolean test_isLtC(double a) {36return a < 7.;37}3839private static boolean test_isLeC(double a) {40return a <= 7.;41}4243private static boolean test_isGeC(double a) {44return a >= 7.;45}4647private static boolean test_isGtC(double a) {48return a > 7.;49}5051private static void assertThat(boolean assertion) {52if (! assertion) {53throw new AssertionError();54}55}5657public static void main(String[] args) {58assertThat(test_isEq(7., 7.));59assertThat(! test_isEq(70., 7.));60assertThat(! test_isNe(7., 7.));61assertThat(test_isNe(70., 7.));6263assertThat(test_isLt(7., 70.));64assertThat(! test_isLt(70., 7.));65assertThat(! test_isLt(7., 7.));6667assertThat(test_isLe(7., 70.));68assertThat(! test_isLe(70., 7.));69assertThat(test_isLe(7., 7.));7071assertThat(!test_isGe(7., 70.));72assertThat(test_isGe(70., 7.));73assertThat(test_isGe(7., 7.));7475assertThat(!test_isGt(7., 70.));76assertThat(test_isGt(70., 7.));77assertThat(! test_isGt(7., 7.));787980assertThat(test_isEqC(7.));81assertThat(! test_isEqC(70.));82assertThat(! test_isNeC(7.));83assertThat(test_isNeC(70.));8485assertThat(test_isLtC(6.));86assertThat(! test_isLtC(70.));87assertThat(! test_isLtC(7.));8889assertThat(test_isLeC(6.));90assertThat(! test_isLeC(70.));91assertThat(test_isLeC(7.));9293assertThat(!test_isGeC(6.));94assertThat(test_isGeC(70.));95assertThat(test_isGeC(7.));9697assertThat(!test_isGtC(6.));98assertThat(test_isGtC(70.));99assertThat(! test_isGtC(7.));100}101}102103104