Mercurial > hg > truffle
comparison graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Math01.java @ 7282:390448a6b535
converted the JTT tests to use the GraalCompilerTest framework which offers more control over what is compiled and executed
the HP_series and FloatingReads tests have been disabled temporarily
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Thu, 20 Dec 2012 14:59:57 +0100 |
parents | e808627bd16f |
children | 0320e6278f84 |
comparison
equal
deleted
inserted
replaced
7281:e960cda050d7 | 7282:390448a6b535 |
---|---|
20 * or visit www.oracle.com if you need additional information or have any | 20 * or visit www.oracle.com if you need additional information or have any |
21 * questions. | 21 * questions. |
22 */ | 22 */ |
23 package com.oracle.graal.jtt.optimize; | 23 package com.oracle.graal.jtt.optimize; |
24 | 24 |
25 import com.oracle.graal.jtt.*; | |
25 import org.junit.*; | 26 import org.junit.*; |
26 | 27 |
27 /* | 28 /* |
28 */ | 29 */ |
29 public class Fold_Math01 { | 30 public class Fold_Math01 extends JTTTest { |
30 | 31 |
31 public static double test(int arg) { | 32 public static double test(int arg) { |
32 switch (arg) { | 33 switch (arg) { |
33 case 0: | 34 case 0: |
34 return abs(); | 35 return abs(); |
106 return Math.max(2, -1); | 107 return Math.max(2, -1); |
107 } | 108 } |
108 | 109 |
109 @Test | 110 @Test |
110 public void run0() throws Throwable { | 111 public void run0() throws Throwable { |
111 Assert.assertEquals(10d, test(0), 0); | 112 runTestWithDelta(0, "test", 0); |
112 } | 113 } |
113 | 114 |
114 @Test | 115 @Test |
115 public void run1() throws Throwable { | 116 public void run1() throws Throwable { |
116 Assert.assertEquals(0.14943813247359922d, test(1), 0); | 117 runTestWithDelta(0, "test", 1); |
117 } | 118 } |
118 | 119 |
119 @Test | 120 @Test |
120 public void run2() throws Throwable { | 121 public void run2() throws Throwable { |
121 Assert.assertEquals(0.9887710779360422d, test(2), 0); | 122 runTestWithDelta(0, "test", 2); |
122 } | 123 } |
123 | 124 |
124 @Test | 125 @Test |
125 public void run3() throws Throwable { | 126 public void run3() throws Throwable { |
126 Assert.assertEquals(0.15113521805829508d, test(3), 0); | 127 runTestWithDelta(0, "test", 3); |
127 } | 128 } |
128 | 129 |
129 @Test | 130 @Test |
130 public void run4() throws Throwable { | 131 public void run4() throws Throwable { |
131 Assert.assertEquals(0.04834938665190287d, test(4), 0); | 132 runTestWithDelta(0, "test", 4); |
132 } | 133 } |
133 | 134 |
134 @Test | 135 @Test |
135 public void run5() throws Throwable { | 136 public void run5() throws Throwable { |
136 Assert.assertEquals(12.0d, test(5), 0); | 137 runTestWithDelta(0, "test", 5); |
137 } | 138 } |
138 | 139 |
139 @Test | 140 @Test |
140 public void run6() throws Throwable { | 141 public void run6() throws Throwable { |
141 Assert.assertEquals(1.1474024528375417d, test(6), 0); | 142 runTestWithDelta(0, "test", 6); |
142 } | 143 } |
143 | 144 |
144 @Test | 145 @Test |
145 public void run7() throws Throwable { | 146 public void run7() throws Throwable { |
146 Assert.assertEquals(-0.8239087409443188d, test(7), 0); | 147 runTestWithDelta(0, "test", 7); |
147 } | 148 } |
148 | 149 |
149 @Test | 150 @Test |
150 public void run8() throws Throwable { | 151 public void run8() throws Throwable { |
151 Assert.assertEquals(106.62882057436371d, test(8), 0); | 152 runTestWithDelta(0, "test", 8); |
152 } | 153 } |
153 | 154 |
154 @Test | 155 @Test |
155 public void run9() throws Throwable { | 156 public void run9() throws Throwable { |
156 Assert.assertEquals(1.1474024528375417d, test(9), 0); | 157 runTestWithDelta(0, "test", 9); |
157 } | 158 } |
158 | 159 |
159 @Test | 160 @Test |
160 public void run10() throws Throwable { | 161 public void run10() throws Throwable { |
161 Assert.assertEquals(-1.0d, test(10), 0); | 162 runTestWithDelta(0, "test", 10); |
162 } | 163 } |
163 | 164 |
164 @Test | 165 @Test |
165 public void run11() throws Throwable { | 166 public void run11() throws Throwable { |
166 Assert.assertEquals(2.0d, test(11), 0); | 167 runTestWithDelta(0, "test", 11); |
167 } | 168 } |
168 | 169 |
169 @Test | 170 @Test |
170 public void run12() throws Throwable { | 171 public void run12() throws Throwable { |
171 Assert.assertEquals(42d, test(12), 0); | 172 runTestWithDelta(0, "test", 12); |
172 } | 173 } |
173 | 174 |
174 } | 175 } |