src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalNodeTest.java
equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
22 */ |
22 */ |
23 |
23 |
24 |
24 |
25 package org.graalvm.compiler.core.test; |
25 package org.graalvm.compiler.core.test; |
26 |
26 |
|
27 import org.graalvm.compiler.nodes.CallTargetNode.InvokeKind; |
27 import org.junit.Test; |
28 import org.junit.Test; |
28 |
29 |
29 public class ConditionalNodeTest extends GraalCompilerTest { |
30 public class ConditionalNodeTest extends GraalCompilerTest { |
30 |
31 |
31 @SuppressWarnings("unused") private static int sink0; |
32 @SuppressWarnings("unused") private static int sink0; |
104 sink1 = 1; |
105 sink1 = 1; |
105 } |
106 } |
106 sink0 = 1; |
107 sink0 = 1; |
107 return Math.min(-1, value); |
108 return Math.min(-1, value); |
108 } |
109 } |
|
110 |
|
111 @Test |
|
112 public void test4() { |
|
113 test("conditionalTest4", this, 0); |
|
114 test("conditionalTest4", this, 1); |
|
115 } |
|
116 |
|
117 int a; |
|
118 InvokeKind b; |
|
119 |
|
120 public static int conditionalTest4(ConditionalNodeTest node, int a) { |
|
121 if (a == 1) { |
|
122 node.b = InvokeKind.Virtual; |
|
123 } else { |
|
124 node.b = InvokeKind.Special; |
|
125 } |
|
126 node.a = a; |
|
127 return a; |
|
128 } |
109 } |
129 } |