Wed, 12 Feb 2014 11:16:22 -0800
Added tag jdk8u11-b00 for changeset c9db8c800797
duke@1 | 1 | /* |
ohair@554 | 2 | * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. |
duke@1 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
duke@1 | 4 | * |
duke@1 | 5 | * This code is free software; you can redistribute it and/or modify it |
duke@1 | 6 | * under the terms of the GNU General Public License version 2 only, as |
duke@1 | 7 | * published by the Free Software Foundation. |
duke@1 | 8 | * |
duke@1 | 9 | * This code is distributed in the hope that it will be useful, but WITHOUT |
duke@1 | 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
duke@1 | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
duke@1 | 12 | * version 2 for more details (a copy is included in the LICENSE file that |
duke@1 | 13 | * accompanied this code). |
duke@1 | 14 | * |
duke@1 | 15 | * You should have received a copy of the GNU General Public License version |
duke@1 | 16 | * 2 along with this work; if not, write to the Free Software Foundation, |
duke@1 | 17 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
duke@1 | 18 | * |
ohair@554 | 19 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
ohair@554 | 20 | * or visit www.oracle.com if you need additional information or have any |
ohair@554 | 21 | * questions. |
duke@1 | 22 | */ |
duke@1 | 23 | |
duke@1 | 24 | /* |
duke@1 | 25 | * @test |
duke@1 | 26 | * @bug 6348760 |
duke@1 | 27 | * @summary crash: java.lang.AssertionError at com.sun.tools.javac.comp.Lower.abstractLval(Lower.java:1853) |
duke@1 | 28 | * @author Peter von der Ah\u00e9 |
duke@1 | 29 | * @run main/othervm -Xfuture T6348760 |
duke@1 | 30 | */ |
duke@1 | 31 | |
duke@1 | 32 | public class T6348760<T> { |
duke@1 | 33 | T value; |
duke@1 | 34 | static int n; |
duke@1 | 35 | |
duke@1 | 36 | T6348760(T value) { |
duke@1 | 37 | this.value = value; |
duke@1 | 38 | } |
duke@1 | 39 | |
duke@1 | 40 | static void testByte(T6348760<Byte> i, T6348760<Byte> j, T6348760<Boolean> a) { |
duke@1 | 41 | i.value++; |
duke@1 | 42 | i.value--; |
duke@1 | 43 | ++i.value; |
duke@1 | 44 | --i.value; |
duke@1 | 45 | n = +i.value; |
duke@1 | 46 | n = -i.value; |
duke@1 | 47 | n = ~i.value; |
duke@1 | 48 | n = i.value * j.value; |
duke@1 | 49 | n = i.value / j.value; |
duke@1 | 50 | n = i.value % j.value; |
duke@1 | 51 | n = i.value + j.value; |
duke@1 | 52 | n = i.value - j.value; |
duke@1 | 53 | n = i.value << j.value; |
duke@1 | 54 | n = i.value >> j.value; |
duke@1 | 55 | n = i.value >>> j.value; |
duke@1 | 56 | n = i.value & j.value; |
duke@1 | 57 | n = i.value ^ j.value; |
duke@1 | 58 | n = i.value | j.value; |
duke@1 | 59 | n *= j.value; |
duke@1 | 60 | n /= j.value; |
duke@1 | 61 | n %= j.value; |
duke@1 | 62 | n += j.value; |
duke@1 | 63 | n -= j.value; |
duke@1 | 64 | n <<= j.value; |
duke@1 | 65 | n >>= j.value; |
duke@1 | 66 | n >>>= j.value; |
duke@1 | 67 | n &= j.value; |
duke@1 | 68 | n ^= j.value; |
duke@1 | 69 | n |= j.value; |
duke@1 | 70 | a.value = i.value < j.value; |
duke@1 | 71 | a.value = i.value > j.value; |
duke@1 | 72 | a.value = i.value <= j.value; |
duke@1 | 73 | a.value = i.value >= j.value; |
duke@1 | 74 | a.value = i.value == j.value; |
duke@1 | 75 | a.value = i.value != j.value; |
duke@1 | 76 | } |
duke@1 | 77 | |
duke@1 | 78 | static void testShort(T6348760<Short> i, T6348760<Short> j, T6348760<Boolean> a) { |
duke@1 | 79 | i.value++; |
duke@1 | 80 | i.value--; |
duke@1 | 81 | ++i.value; |
duke@1 | 82 | --i.value; |
duke@1 | 83 | n = +i.value; |
duke@1 | 84 | n = -i.value; |
duke@1 | 85 | n = ~i.value; |
duke@1 | 86 | n = i.value * j.value; |
duke@1 | 87 | n = i.value / j.value; |
duke@1 | 88 | n = i.value % j.value; |
duke@1 | 89 | n = i.value + j.value; |
duke@1 | 90 | n = i.value - j.value; |
duke@1 | 91 | n = i.value << j.value; |
duke@1 | 92 | n = i.value >> j.value; |
duke@1 | 93 | n = i.value >>> j.value; |
duke@1 | 94 | n = i.value & j.value; |
duke@1 | 95 | n = i.value ^ j.value; |
duke@1 | 96 | n = i.value | j.value; |
duke@1 | 97 | n *= j.value; |
duke@1 | 98 | n /= j.value; |
duke@1 | 99 | n %= j.value; |
duke@1 | 100 | n += j.value; |
duke@1 | 101 | n -= j.value; |
duke@1 | 102 | n <<= j.value; |
duke@1 | 103 | n >>= j.value; |
duke@1 | 104 | n >>>= j.value; |
duke@1 | 105 | n &= j.value; |
duke@1 | 106 | n ^= j.value; |
duke@1 | 107 | n |= j.value; |
duke@1 | 108 | a.value = i.value < j.value; |
duke@1 | 109 | a.value = i.value > j.value; |
duke@1 | 110 | a.value = i.value <= j.value; |
duke@1 | 111 | a.value = i.value >= j.value; |
duke@1 | 112 | a.value = i.value == j.value; |
duke@1 | 113 | a.value = i.value != j.value; |
duke@1 | 114 | } |
duke@1 | 115 | |
duke@1 | 116 | static void testInteger(T6348760<Integer> i, T6348760<Integer> j, T6348760<Boolean> a) { |
duke@1 | 117 | i.value++; |
duke@1 | 118 | i.value--; |
duke@1 | 119 | ++i.value; |
duke@1 | 120 | --i.value; |
duke@1 | 121 | i.value = +i.value; |
duke@1 | 122 | i.value = -i.value; |
duke@1 | 123 | i.value = ~i.value; |
duke@1 | 124 | i.value = i.value * j.value; |
duke@1 | 125 | i.value = i.value / j.value; |
duke@1 | 126 | i.value = i.value % j.value; |
duke@1 | 127 | i.value = i.value + j.value; |
duke@1 | 128 | i.value = i.value - j.value; |
duke@1 | 129 | i.value = i.value << j.value; |
duke@1 | 130 | i.value = i.value >> j.value; |
duke@1 | 131 | i.value = i.value >>> j.value; |
duke@1 | 132 | i.value = i.value & j.value; |
duke@1 | 133 | i.value = i.value ^ j.value; |
duke@1 | 134 | i.value = i.value | j.value; |
duke@1 | 135 | i.value *= j.value; |
duke@1 | 136 | i.value /= j.value; |
duke@1 | 137 | i.value %= j.value; |
duke@1 | 138 | i.value += j.value; |
duke@1 | 139 | i.value -= j.value; |
duke@1 | 140 | i.value <<= j.value; |
duke@1 | 141 | i.value >>= j.value; |
duke@1 | 142 | i.value >>>= j.value; |
duke@1 | 143 | i.value &= j.value; |
duke@1 | 144 | i.value ^= j.value; |
duke@1 | 145 | i.value |= j.value; |
duke@1 | 146 | a.value = i.value < j.value; |
duke@1 | 147 | a.value = i.value > j.value; |
duke@1 | 148 | a.value = i.value <= j.value; |
duke@1 | 149 | a.value = i.value >= j.value; |
duke@1 | 150 | a.value = i.value == j.value; |
duke@1 | 151 | a.value = i.value != j.value; |
duke@1 | 152 | } |
duke@1 | 153 | |
duke@1 | 154 | static void testLong(T6348760<Long> i, T6348760<Long> j, T6348760<Boolean> a) { |
duke@1 | 155 | i.value++; |
duke@1 | 156 | i.value--; |
duke@1 | 157 | ++i.value; |
duke@1 | 158 | --i.value; |
duke@1 | 159 | i.value = +i.value; |
duke@1 | 160 | i.value = -i.value; |
duke@1 | 161 | i.value = ~i.value; |
duke@1 | 162 | i.value = i.value * j.value; |
duke@1 | 163 | i.value = i.value / j.value; |
duke@1 | 164 | i.value = i.value % j.value; |
duke@1 | 165 | i.value = i.value + j.value; |
duke@1 | 166 | i.value = i.value - j.value; |
duke@1 | 167 | i.value = i.value << j.value; |
duke@1 | 168 | i.value = i.value >> j.value; |
duke@1 | 169 | i.value = i.value >>> j.value; |
duke@1 | 170 | i.value = i.value & j.value; |
duke@1 | 171 | i.value = i.value ^ j.value; |
duke@1 | 172 | i.value = i.value | j.value; |
duke@1 | 173 | i.value *= j.value; |
duke@1 | 174 | i.value /= j.value; |
duke@1 | 175 | i.value %= j.value; |
duke@1 | 176 | i.value += j.value; |
duke@1 | 177 | i.value -= j.value; |
duke@1 | 178 | i.value <<= j.value; |
duke@1 | 179 | i.value >>= j.value; |
duke@1 | 180 | i.value >>>= j.value; |
duke@1 | 181 | i.value &= j.value; |
duke@1 | 182 | i.value ^= j.value; |
duke@1 | 183 | i.value |= j.value; |
duke@1 | 184 | a.value = i.value < j.value; |
duke@1 | 185 | a.value = i.value > j.value; |
duke@1 | 186 | a.value = i.value <= j.value; |
duke@1 | 187 | a.value = i.value >= j.value; |
duke@1 | 188 | a.value = i.value == j.value; |
duke@1 | 189 | a.value = i.value != j.value; |
duke@1 | 190 | } |
duke@1 | 191 | |
duke@1 | 192 | static void testCharacter(T6348760<Character> i, T6348760<Character> j, T6348760<Boolean> a) { |
duke@1 | 193 | i.value++; |
duke@1 | 194 | i.value--; |
duke@1 | 195 | ++i.value; |
duke@1 | 196 | --i.value; |
duke@1 | 197 | n = +i.value; |
duke@1 | 198 | n = -i.value; |
duke@1 | 199 | n = ~i.value; |
duke@1 | 200 | n = i.value * j.value; |
duke@1 | 201 | n = i.value / j.value; |
duke@1 | 202 | n = i.value % j.value; |
duke@1 | 203 | n = i.value + j.value; |
duke@1 | 204 | n = i.value - j.value; |
duke@1 | 205 | n = i.value << j.value; |
duke@1 | 206 | n = i.value >> j.value; |
duke@1 | 207 | n = i.value >>> j.value; |
duke@1 | 208 | n = i.value & j.value; |
duke@1 | 209 | n = i.value ^ j.value; |
duke@1 | 210 | n = i.value | j.value; |
duke@1 | 211 | n *= j.value; |
duke@1 | 212 | n /= j.value; |
duke@1 | 213 | n %= j.value; |
duke@1 | 214 | n += j.value; |
duke@1 | 215 | n -= j.value; |
duke@1 | 216 | n <<= j.value; |
duke@1 | 217 | n >>= j.value; |
duke@1 | 218 | n >>>= j.value; |
duke@1 | 219 | n &= j.value; |
duke@1 | 220 | n ^= j.value; |
duke@1 | 221 | n |= j.value; |
duke@1 | 222 | a.value = i.value < j.value; |
duke@1 | 223 | a.value = i.value > j.value; |
duke@1 | 224 | a.value = i.value <= j.value; |
duke@1 | 225 | a.value = i.value >= j.value; |
duke@1 | 226 | a.value = i.value == j.value; |
duke@1 | 227 | a.value = i.value != j.value; |
duke@1 | 228 | } |
duke@1 | 229 | |
duke@1 | 230 | static void testFloat(T6348760<Float> i, T6348760<Float> j, T6348760<Boolean> a) { |
duke@1 | 231 | i.value++; |
duke@1 | 232 | i.value--; |
duke@1 | 233 | ++i.value; |
duke@1 | 234 | --i.value; |
duke@1 | 235 | i.value = +i.value; |
duke@1 | 236 | i.value = -i.value; |
duke@1 | 237 | // i.value = ~i.value; |
duke@1 | 238 | i.value = i.value * j.value; |
duke@1 | 239 | i.value = i.value / j.value; |
duke@1 | 240 | i.value = i.value % j.value; |
duke@1 | 241 | i.value = i.value + j.value; |
duke@1 | 242 | i.value = i.value - j.value; |
duke@1 | 243 | // i.value = i.value << j.value; |
duke@1 | 244 | // i.value = i.value >> j.value; |
duke@1 | 245 | // i.value = i.value >>> j.value; |
duke@1 | 246 | // i.value = i.value & j.value; |
duke@1 | 247 | // i.value = i.value ^ j.value; |
duke@1 | 248 | // i.value = i.value | j.value; |
duke@1 | 249 | i.value *= j.value; |
duke@1 | 250 | i.value /= j.value; |
duke@1 | 251 | i.value %= j.value; |
duke@1 | 252 | i.value += j.value; |
duke@1 | 253 | i.value -= j.value; |
duke@1 | 254 | // i.value <<= j.value; |
duke@1 | 255 | // i.value >>= j.value; |
duke@1 | 256 | // i.value >>>= j.value; |
duke@1 | 257 | // i.value &= j.value; |
duke@1 | 258 | // i.value ^= j.value; |
duke@1 | 259 | // i.value |= j.value; |
duke@1 | 260 | a.value = i.value < j.value; |
duke@1 | 261 | a.value = i.value > j.value; |
duke@1 | 262 | a.value = i.value <= j.value; |
duke@1 | 263 | a.value = i.value >= j.value; |
duke@1 | 264 | a.value = i.value == j.value; |
duke@1 | 265 | a.value = i.value != j.value; |
duke@1 | 266 | } |
duke@1 | 267 | |
duke@1 | 268 | static void testDouble(T6348760<Double> i, T6348760<Double> j, T6348760<Boolean> a) { |
duke@1 | 269 | i.value++; |
duke@1 | 270 | i.value--; |
duke@1 | 271 | ++i.value; |
duke@1 | 272 | --i.value; |
duke@1 | 273 | i.value = +i.value; |
duke@1 | 274 | i.value = -i.value; |
duke@1 | 275 | // i.value = ~i.value; |
duke@1 | 276 | i.value = i.value * j.value; |
duke@1 | 277 | i.value = i.value / j.value; |
duke@1 | 278 | i.value = i.value % j.value; |
duke@1 | 279 | i.value = i.value + j.value; |
duke@1 | 280 | i.value = i.value - j.value; |
duke@1 | 281 | // i.value = i.value << j.value; |
duke@1 | 282 | // i.value = i.value >> j.value; |
duke@1 | 283 | // i.value = i.value >>> j.value; |
duke@1 | 284 | // i.value = i.value & j.value; |
duke@1 | 285 | // i.value = i.value ^ j.value; |
duke@1 | 286 | // i.value = i.value | j.value; |
duke@1 | 287 | i.value *= j.value; |
duke@1 | 288 | i.value /= j.value; |
duke@1 | 289 | i.value %= j.value; |
duke@1 | 290 | i.value += j.value; |
duke@1 | 291 | i.value -= j.value; |
duke@1 | 292 | // i.value <<= j.value; |
duke@1 | 293 | // i.value >>= j.value; |
duke@1 | 294 | // i.value >>>= j.value; |
duke@1 | 295 | // i.value &= j.value; |
duke@1 | 296 | // i.value ^= j.value; |
duke@1 | 297 | // i.value |= j.value; |
duke@1 | 298 | a.value = i.value < j.value; |
duke@1 | 299 | a.value = i.value > j.value; |
duke@1 | 300 | a.value = i.value <= j.value; |
duke@1 | 301 | a.value = i.value >= j.value; |
duke@1 | 302 | a.value = i.value == j.value; |
duke@1 | 303 | a.value = i.value != j.value; |
duke@1 | 304 | } |
duke@1 | 305 | |
duke@1 | 306 | static void testBoolean(T6348760<Boolean> i, T6348760<Boolean> j, T6348760<Boolean> a) { |
duke@1 | 307 | // i.value++; |
duke@1 | 308 | // i.value--; |
duke@1 | 309 | // ++i.value; |
duke@1 | 310 | // --i.value; |
duke@1 | 311 | // i.value = +i.value; |
duke@1 | 312 | // i.value = -i.value; |
duke@1 | 313 | // i.value = ~i.value; |
duke@1 | 314 | // i.value = i.value * j.value; |
duke@1 | 315 | // i.value = i.value / j.value; |
duke@1 | 316 | // i.value = i.value % j.value; |
duke@1 | 317 | // i.value = i.value + j.value; |
duke@1 | 318 | // i.value = i.value - j.value; |
duke@1 | 319 | // i.value = i.value << j.value; |
duke@1 | 320 | // i.value = i.value >> j.value; |
duke@1 | 321 | // i.value = i.value >>> j.value; |
duke@1 | 322 | i.value = i.value & j.value; |
duke@1 | 323 | i.value = i.value ^ j.value; |
duke@1 | 324 | i.value = i.value | j.value; |
duke@1 | 325 | // i.value *= j.value; |
duke@1 | 326 | // i.value /= j.value; |
duke@1 | 327 | // i.value %= j.value; |
duke@1 | 328 | // i.value += j.value; |
duke@1 | 329 | // i.value -= j.value; |
duke@1 | 330 | // i.value <<= j.value; |
duke@1 | 331 | // i.value >>= j.value; |
duke@1 | 332 | // i.value >>>= j.value; |
duke@1 | 333 | i.value &= j.value; |
duke@1 | 334 | i.value ^= j.value; |
duke@1 | 335 | i.value |= j.value; |
duke@1 | 336 | // a.value = i.value < j.value; |
duke@1 | 337 | // a.value = i.value > j.value; |
duke@1 | 338 | // a.value = i.value <= j.value; |
duke@1 | 339 | // a.value = i.value >= j.value; |
duke@1 | 340 | a.value = i.value == j.value; |
duke@1 | 341 | a.value = i.value != j.value; |
duke@1 | 342 | a.value = !j.value; |
duke@1 | 343 | a.value = i.value && j.value; |
duke@1 | 344 | a.value = i.value || j.value; |
duke@1 | 345 | } |
duke@1 | 346 | |
duke@1 | 347 | |
duke@1 | 348 | public static void main(String... args) { |
duke@1 | 349 | testByte (new T6348760<Byte>((byte)42), |
duke@1 | 350 | new T6348760<Byte>((byte)42), |
duke@1 | 351 | new T6348760<Boolean>(true)); |
duke@1 | 352 | testShort (new T6348760<Short>((short)42), |
duke@1 | 353 | new T6348760<Short>((short)42), |
duke@1 | 354 | new T6348760<Boolean>(true)); |
duke@1 | 355 | testInteger (new T6348760<Integer>(42), |
duke@1 | 356 | new T6348760<Integer>(42), |
duke@1 | 357 | new T6348760<Boolean>(true)); |
duke@1 | 358 | testLong (new T6348760<Long>(42L), |
duke@1 | 359 | new T6348760<Long>(42L), |
duke@1 | 360 | new T6348760<Boolean>(true)); |
duke@1 | 361 | testCharacter(new T6348760<Character>('*'), |
duke@1 | 362 | new T6348760<Character>('*'), |
duke@1 | 363 | new T6348760<Boolean>(true)); |
duke@1 | 364 | testFloat (new T6348760<Float>(42.0F), |
duke@1 | 365 | new T6348760<Float>(42.0F), |
duke@1 | 366 | new T6348760<Boolean>(true)); |
duke@1 | 367 | testDouble (new T6348760<Double>(42.0D), |
duke@1 | 368 | new T6348760<Double>(42.0D), |
duke@1 | 369 | new T6348760<Boolean>(true)); |
duke@1 | 370 | testBoolean (new T6348760<Boolean>(true), |
duke@1 | 371 | new T6348760<Boolean>(true), |
duke@1 | 372 | new T6348760<Boolean>(true)); |
duke@1 | 373 | } |
duke@1 | 374 | } |