98 public @Stable byte v; |
98 public @Stable byte v; |
99 |
99 |
100 public static final DefaultValue c = new DefaultValue(); |
100 public static final DefaultValue c = new DefaultValue(); |
101 public static byte get() { return c.v; } |
101 public static byte get() { return c.v; } |
102 public static void test() throws Exception { |
102 public static void test() throws Exception { |
103 byte val1 = get(); |
103 byte val1 = get(); |
104 c.v = 1; byte val2 = get(); |
104 c.v = 1; byte val2 = get(); |
105 assertEquals(val1, 0); |
105 assertEquals(val1, 0); |
106 assertEquals(val2, 1); |
106 assertEquals(val2, 1); |
107 } |
107 } |
108 } |
108 } |
128 public static @Stable byte v; |
128 public static @Stable byte v; |
129 |
129 |
130 public static final DefaultStaticValue c = new DefaultStaticValue(); |
130 public static final DefaultStaticValue c = new DefaultStaticValue(); |
131 public static byte get() { return c.v; } |
131 public static byte get() { return c.v; } |
132 public static void test() throws Exception { |
132 public static void test() throws Exception { |
133 byte val1 = get(); |
133 byte val1 = get(); |
134 c.v = 1; byte val2 = get(); |
134 c.v = 1; byte val2 = get(); |
135 assertEquals(val1, 0); |
135 assertEquals(val1, 0); |
136 assertEquals(val2, 1); |
136 assertEquals(val2, 1); |
137 } |
137 } |
138 } |
138 } |
178 public static byte get1() { return c.v[10]; } |
178 public static byte get1() { return c.v[10]; } |
179 public static byte[] get2() { return c.v; } |
179 public static byte[] get2() { return c.v; } |
180 public static void test() throws Exception { |
180 public static void test() throws Exception { |
181 { |
181 { |
182 c.v = new byte[1]; c.v[0] = 1; byte val1 = get(); |
182 c.v = new byte[1]; c.v[0] = 1; byte val1 = get(); |
183 c.v[0] = 2; byte val2 = get(); |
183 c.v[0] = 2; byte val2 = get(); |
184 assertEquals(val1, 1); |
184 assertEquals(val1, 1); |
185 assertEquals(val2, (isStableEnabled ? 1 : 2)); |
185 assertEquals(val2, (isStableEnabled ? 1 : 2)); |
186 |
186 |
187 c.v = new byte[1]; c.v[0] = 3; byte val3 = get(); |
187 c.v = new byte[1]; c.v[0] = 3; byte val3 = get(); |
188 assertEquals(val3, (isStableEnabled ? (isStableEnabled ? 1 : 2) |
188 assertEquals(val3, (isStableEnabled ? (isStableEnabled ? 1 : 2) |
189 : 3)); |
189 : 3)); |
190 } |
190 } |
191 |
191 |
192 { |
192 { |
193 c.v = new byte[20]; c.v[10] = 1; byte val1 = get1(); |
193 c.v = new byte[20]; c.v[10] = 1; byte val1 = get1(); |
194 c.v[10] = 2; byte val2 = get1(); |
194 c.v[10] = 2; byte val2 = get1(); |
195 assertEquals(val1, 1); |
195 assertEquals(val1, 1); |
196 assertEquals(val2, (isStableEnabled ? 1 : 2)); |
196 assertEquals(val2, (isStableEnabled ? 1 : 2)); |
197 |
197 |
198 c.v = new byte[20]; c.v[10] = 3; byte val3 = get1(); |
198 c.v = new byte[20]; c.v[10] = 3; byte val3 = get1(); |
199 assertEquals(val3, (isStableEnabled ? (isStableEnabled ? 1 : 2) |
199 assertEquals(val3, (isStableEnabled ? (isStableEnabled ? 1 : 2) |
200 : 3)); |
200 : 3)); |
201 } |
201 } |
202 |
202 |
203 { |
203 { |
204 c.v = new byte[1]; byte[] val1 = get2(); |
204 c.v = new byte[1]; byte[] val1 = get2(); |
205 c.v = new byte[1]; byte[] val2 = get2(); |
205 c.v = new byte[1]; byte[] val2 = get2(); |
218 public static byte[] get1() { return c.v[0]; } |
218 public static byte[] get1() { return c.v[0]; } |
219 public static byte[][] get2() { return c.v; } |
219 public static byte[][] get2() { return c.v; } |
220 public static void test() throws Exception { |
220 public static void test() throws Exception { |
221 { |
221 { |
222 c.v = new byte[1][1]; c.v[0][0] = 1; byte val1 = get(); |
222 c.v = new byte[1][1]; c.v[0][0] = 1; byte val1 = get(); |
223 c.v[0][0] = 2; byte val2 = get(); |
223 c.v[0][0] = 2; byte val2 = get(); |
224 assertEquals(val1, 1); |
224 assertEquals(val1, 1); |
225 assertEquals(val2, (isStableEnabled ? 1 : 2)); |
225 assertEquals(val2, (isStableEnabled ? 1 : 2)); |
226 |
226 |
227 c.v = new byte[1][1]; c.v[0][0] = 3; byte val3 = get(); |
227 c.v = new byte[1][1]; c.v[0][0] = 3; byte val3 = get(); |
228 assertEquals(val3, (isStableEnabled ? (isStableEnabled ? 1 : 2) |
228 assertEquals(val3, (isStableEnabled ? (isStableEnabled ? 1 : 2) |
229 : 3)); |
229 : 3)); |
230 |
230 |
231 c.v[0] = new byte[1]; c.v[0][0] = 4; byte val4 = get(); |
231 c.v[0] = new byte[1]; c.v[0][0] = 4; byte val4 = get(); |
232 assertEquals(val4, (isStableEnabled ? (isStableEnabled ? 1 : 2) |
232 assertEquals(val4, (isStableEnabled ? (isStableEnabled ? 1 : 2) |
233 : 4)); |
233 : 4)); |
234 } |
234 } |
235 |
235 |
236 { |
236 { |
237 c.v = new byte[1][1]; byte[] val1 = get1(); |
237 c.v = new byte[1][1]; byte[] val1 = get1(); |
238 c.v[0] = new byte[1]; byte[] val2 = get1(); |
238 c.v[0] = new byte[1]; byte[] val2 = get1(); |
258 public static byte[][] get2() { return c.v[0]; } |
258 public static byte[][] get2() { return c.v[0]; } |
259 public static byte[][][] get3() { return c.v; } |
259 public static byte[][][] get3() { return c.v; } |
260 public static void test() throws Exception { |
260 public static void test() throws Exception { |
261 { |
261 { |
262 c.v = new byte[1][1][1]; c.v[0][0][0] = 1; byte val1 = get(); |
262 c.v = new byte[1][1][1]; c.v[0][0][0] = 1; byte val1 = get(); |
263 c.v[0][0][0] = 2; byte val2 = get(); |
263 c.v[0][0][0] = 2; byte val2 = get(); |
264 assertEquals(val1, 1); |
264 assertEquals(val1, 1); |
265 assertEquals(val2, (isStableEnabled ? 1 : 2)); |
265 assertEquals(val2, (isStableEnabled ? 1 : 2)); |
266 |
266 |
267 c.v = new byte[1][1][1]; c.v[0][0][0] = 3; byte val3 = get(); |
267 c.v = new byte[1][1][1]; c.v[0][0][0] = 3; byte val3 = get(); |
268 assertEquals(val3, (isStableEnabled ? (isStableEnabled ? 1 : 2) |
268 assertEquals(val3, (isStableEnabled ? (isStableEnabled ? 1 : 2) |
269 : 3)); |
269 : 3)); |
270 |
270 |
271 c.v[0] = new byte[1][1]; c.v[0][0][0] = 4; byte val4 = get(); |
271 c.v[0] = new byte[1][1]; c.v[0][0][0] = 4; byte val4 = get(); |
272 assertEquals(val4, (isStableEnabled ? (isStableEnabled ? 1 : 2) |
272 assertEquals(val4, (isStableEnabled ? (isStableEnabled ? 1 : 2) |
273 : 4)); |
273 : 4)); |
274 |
274 |
275 c.v[0][0] = new byte[1]; c.v[0][0][0] = 5; byte val5 = get(); |
275 c.v[0][0] = new byte[1]; c.v[0][0][0] = 5; byte val5 = get(); |
276 assertEquals(val5, (isStableEnabled ? (isStableEnabled ? 1 : 2) |
276 assertEquals(val5, (isStableEnabled ? (isStableEnabled ? 1 : 2) |
277 : 5)); |
277 : 5)); |
278 } |
278 } |
279 |
279 |
280 { |
280 { |
281 c.v = new byte[1][1][1]; byte[] val1 = get1(); |
281 c.v = new byte[1][1][1]; byte[] val1 = get1(); |
282 c.v[0][0] = new byte[1]; byte[] val2 = get1(); |
282 c.v[0][0] = new byte[1]; byte[] val2 = get1(); |
309 public static byte[][][] get3() { return c.v[0]; } |
309 public static byte[][][] get3() { return c.v[0]; } |
310 public static byte[][][][] get4() { return c.v; } |
310 public static byte[][][][] get4() { return c.v; } |
311 public static void test() throws Exception { |
311 public static void test() throws Exception { |
312 { |
312 { |
313 c.v = new byte[1][1][1][1]; c.v[0][0][0][0] = 1; byte val1 = get(); |
313 c.v = new byte[1][1][1][1]; c.v[0][0][0][0] = 1; byte val1 = get(); |
314 c.v[0][0][0][0] = 2; byte val2 = get(); |
314 c.v[0][0][0][0] = 2; byte val2 = get(); |
315 assertEquals(val1, 1); |
315 assertEquals(val1, 1); |
316 assertEquals(val2, (isStableEnabled ? 1 : 2)); |
316 assertEquals(val2, (isStableEnabled ? 1 : 2)); |
317 |
317 |
318 c.v = new byte[1][1][1][1]; c.v[0][0][0][0] = 3; byte val3 = get(); |
318 c.v = new byte[1][1][1][1]; c.v[0][0][0][0] = 3; byte val3 = get(); |
319 assertEquals(val3, (isStableEnabled ? (isStableEnabled ? 1 : 2) |
319 assertEquals(val3, (isStableEnabled ? (isStableEnabled ? 1 : 2) |
320 : 3)); |
320 : 3)); |
321 |
321 |
322 c.v[0] = new byte[1][1][1]; c.v[0][0][0][0] = 4; byte val4 = get(); |
322 c.v[0] = new byte[1][1][1]; c.v[0][0][0][0] = 4; byte val4 = get(); |
323 assertEquals(val4, (isStableEnabled ? (isStableEnabled ? 1 : 2) |
323 assertEquals(val4, (isStableEnabled ? (isStableEnabled ? 1 : 2) |
324 : 4)); |
324 : 4)); |
325 |
325 |
326 c.v[0][0] = new byte[1][1]; c.v[0][0][0][0] = 5; byte val5 = get(); |
326 c.v[0][0] = new byte[1][1]; c.v[0][0][0][0] = 5; byte val5 = get(); |
327 assertEquals(val5, (isStableEnabled ? (isStableEnabled ? 1 : 2) |
327 assertEquals(val5, (isStableEnabled ? (isStableEnabled ? 1 : 2) |
328 : 5)); |
328 : 5)); |
329 |
329 |
330 c.v[0][0][0] = new byte[1]; c.v[0][0][0][0] = 6; byte val6 = get(); |
330 c.v[0][0][0] = new byte[1]; c.v[0][0][0][0] = 6; byte val6 = get(); |
331 assertEquals(val6, (isStableEnabled ? (isStableEnabled ? 1 : 2) |
331 assertEquals(val6, (isStableEnabled ? (isStableEnabled ? 1 : 2) |
332 : 6)); |
332 : 6)); |
333 } |
333 } |
334 |
334 |
335 { |
335 { |
336 c.v = new byte[1][1][1][1]; byte[] val1 = get1(); |
336 c.v = new byte[1][1][1][1]; byte[] val1 = get1(); |
337 c.v[0][0][0] = new byte[1]; byte[] val2 = get1(); |
337 c.v[0][0][0] = new byte[1]; byte[] val2 = get1(); |
370 public static byte[] get1() { return (byte[])c.v; } |
370 public static byte[] get1() { return (byte[])c.v; } |
371 |
371 |
372 public static void test() throws Exception { |
372 public static void test() throws Exception { |
373 { |
373 { |
374 c.v = new byte[1]; ((byte[])c.v)[0] = 1; byte val1 = get(); |
374 c.v = new byte[1]; ((byte[])c.v)[0] = 1; byte val1 = get(); |
375 ((byte[])c.v)[0] = 2; byte val2 = get(); |
375 ((byte[])c.v)[0] = 2; byte val2 = get(); |
376 |
376 |
377 assertEquals(val1, 1); |
377 assertEquals(val1, 1); |
378 assertEquals(val2, 2); |
378 assertEquals(val2, 2); |
379 } |
379 } |
380 |
380 |
397 public static Object[] get2() { return c.v; } |
397 public static Object[] get2() { return c.v; } |
398 |
398 |
399 public static void test() throws Exception { |
399 public static void test() throws Exception { |
400 { |
400 { |
401 c.v = new byte[1][1]; ((byte[][])c.v)[0][0] = 1; byte val1 = get(); |
401 c.v = new byte[1][1]; ((byte[][])c.v)[0][0] = 1; byte val1 = get(); |
402 ((byte[][])c.v)[0][0] = 2; byte val2 = get(); |
402 ((byte[][])c.v)[0][0] = 2; byte val2 = get(); |
403 |
403 |
404 assertEquals(val1, 1); |
404 assertEquals(val1, 1); |
405 assertEquals(val2, 2); |
405 assertEquals(val2, 2); |
406 } |
406 } |
407 |
407 |
408 { |
408 { |
409 c.v = new byte[1][1]; c.v[0] = new byte[0]; byte[] val1 = get1(); |
409 c.v = new byte[1][1]; c.v[0] = new byte[0]; byte[] val1 = get1(); |
410 c.v[0] = new byte[0]; byte[] val2 = get1(); |
410 c.v[0] = new byte[0]; byte[] val2 = get1(); |
411 |
411 |
412 assertTrue((isStableEnabled ? (val1 == val2) : (val1 != val2))); |
412 assertTrue((isStableEnabled ? (val1 == val2) : (val1 != val2))); |
413 } |
413 } |
414 |
414 |
415 { |
415 { |
432 public static byte[][] get2() { return (byte[][])(c.v[0]); } |
432 public static byte[][] get2() { return (byte[][])(c.v[0]); } |
433 public static Object[][] get3() { return c.v; } |
433 public static Object[][] get3() { return c.v; } |
434 |
434 |
435 public static void test() throws Exception { |
435 public static void test() throws Exception { |
436 { |
436 { |
437 c.v = new byte[1][1][1]; ((byte[][][])c.v)[0][0][0] = 1; byte val1 = get(); |
437 c.v = new byte[1][1][1]; ((byte[][][])c.v)[0][0][0] = 1; byte val1 = get(); |
438 ((byte[][][])c.v)[0][0][0] = 2; byte val2 = get(); |
438 ((byte[][][])c.v)[0][0][0] = 2; byte val2 = get(); |
439 |
439 |
440 assertEquals(val1, 1); |
440 assertEquals(val1, 1); |
441 assertEquals(val2, 2); |
441 assertEquals(val2, 2); |
442 } |
442 } |
443 |
443 |
444 { |
444 { |
445 c.v = new byte[1][1][1]; c.v[0][0] = new byte[0]; byte[] val1 = get1(); |
445 c.v = new byte[1][1][1]; c.v[0][0] = new byte[0]; byte[] val1 = get1(); |
446 c.v[0][0] = new byte[0]; byte[] val2 = get1(); |
446 c.v[0][0] = new byte[0]; byte[] val2 = get1(); |
447 |
447 |
448 assertTrue((isStableEnabled ? (val1 == val2) : (val1 != val2))); |
448 assertTrue((isStableEnabled ? (val1 == val2) : (val1 != val2))); |
449 } |
449 } |
450 |
450 |
451 { |
451 { |
452 c.v = new byte[1][1][1]; c.v[0] = new byte[0][0]; byte[][] val1 = get2(); |
452 c.v = new byte[1][1][1]; c.v[0] = new byte[0][0]; byte[][] val1 = get2(); |
453 c.v[0] = new byte[0][0]; byte[][] val2 = get2(); |
453 c.v[0] = new byte[0][0]; byte[][] val2 = get2(); |
454 |
454 |
455 assertTrue((isStableEnabled ? (val1 == val2) : (val1 != val2))); |
455 assertTrue((isStableEnabled ? (val1 == val2) : (val1 != val2))); |
456 } |
456 } |
457 |
457 |
458 { |
458 { |
478 public static byte get1() { return get().a; } |
478 public static byte get1() { return get().a; } |
479 |
479 |
480 public static void test() throws Exception { |
480 public static void test() throws Exception { |
481 { |
481 { |
482 c.v = new A(); c.v.a = 1; A val1 = get(); |
482 c.v = new A(); c.v.a = 1; A val1 = get(); |
483 c.v.a = 2; A val2 = get(); |
483 c.v.a = 2; A val2 = get(); |
484 |
484 |
485 assertEquals(val1.a, 2); |
485 assertEquals(val1.a, 2); |
486 assertEquals(val2.a, 2); |
486 assertEquals(val2.a, 2); |
487 } |
487 } |
488 |
488 |
489 { |
489 { |
490 c.v = new A(); c.v.a = 1; byte val1 = get1(); |
490 c.v = new A(); c.v.a = 1; byte val1 = get1(); |
491 c.v.a = 2; byte val2 = get1(); |
491 c.v.a = 2; byte val2 = get1(); |
492 c.v = new A(); c.v.a = 3; byte val3 = get1(); |
492 c.v = new A(); c.v.a = 3; byte val3 = get1(); |
493 |
493 |
494 assertEquals(val1, 1); |
494 assertEquals(val1, 1); |
495 assertEquals(val2, (isStableEnabled ? 1 : 2)); |
495 assertEquals(val2, (isStableEnabled ? 1 : 2)); |
496 assertEquals(val3, (isStableEnabled ? 1 : 3)); |
496 assertEquals(val3, (isStableEnabled ? 1 : 3)); |
512 public static byte get1() { return get().a; } |
512 public static byte get1() { return get().a; } |
513 |
513 |
514 public static void test() throws Exception { |
514 public static void test() throws Exception { |
515 { |
515 { |
516 c.v = new A(); c.v.next = new A(); c.v.next.next = c.v; |
516 c.v = new A(); c.v.next = new A(); c.v.next.next = c.v; |
517 c.v.a = 1; c.v.next.a = 1; A val1 = get(); |
517 c.v.a = 1; c.v.next.a = 1; A val1 = get(); |
518 c.v.a = 2; c.v.next.a = 2; A val2 = get(); |
518 c.v.a = 2; c.v.next.a = 2; A val2 = get(); |
519 |
519 |
520 assertEquals(val1.a, 2); |
520 assertEquals(val1.a, 2); |
521 assertEquals(val2.a, 2); |
521 assertEquals(val2.a, 2); |
522 } |
522 } |
523 |
523 |
524 { |
524 { |
525 c.v = new A(); c.v.next = c.v; |
525 c.v = new A(); c.v.next = c.v; |
526 c.v.a = 1; byte val1 = get1(); |
526 c.v.a = 1; byte val1 = get1(); |
527 c.v.a = 2; byte val2 = get1(); |
527 c.v.a = 2; byte val2 = get1(); |
528 c.v = new A(); c.v.next = c.v; |
528 c.v = new A(); c.v.next = c.v; |
529 c.v.a = 3; byte val3 = get1(); |
529 c.v.a = 3; byte val3 = get1(); |
530 |
530 |
531 assertEquals(val1, 1); |
531 assertEquals(val1, 1); |
532 assertEquals(val2, (isStableEnabled ? 1 : 2)); |
532 assertEquals(val2, (isStableEnabled ? 1 : 2)); |
533 assertEquals(val3, (isStableEnabled ? 1 : 3)); |
533 assertEquals(val3, (isStableEnabled ? 1 : 3)); |
534 } |
534 } |
550 public static byte get1() { return c.v.left.left.right.left.a; } |
550 public static byte get1() { return c.v.left.left.right.left.a; } |
551 |
551 |
552 public static void test() throws Exception { |
552 public static void test() throws Exception { |
553 { |
553 { |
554 c.v = new A(); c.v.left = c.v.right = c.v; |
554 c.v = new A(); c.v.left = c.v.right = c.v; |
555 c.v.a = 1; byte val1 = get(); byte val2 = get1(); |
555 c.v.a = 1; byte val1 = get(); byte val2 = get1(); |
556 c.v.a = 2; byte val3 = get(); byte val4 = get1(); |
556 c.v.a = 2; byte val3 = get(); byte val4 = get1(); |
557 |
557 |
558 assertEquals(val1, 1); |
558 assertEquals(val1, 1); |
559 assertEquals(val3, (isStableEnabled ? 1 : 2)); |
559 assertEquals(val3, (isStableEnabled ? 1 : 2)); |
560 |
560 |
561 assertEquals(val2, 1); |
561 assertEquals(val2, 1); |
581 |
581 |
582 public static void test() throws Exception { |
582 public static void test() throws Exception { |
583 { |
583 { |
584 A elem = new A(); |
584 A elem = new A(); |
585 c.v = new A[] { elem, elem }; c.v[0].left = c.v[0].right = c.v; |
585 c.v = new A[] { elem, elem }; c.v[0].left = c.v[0].right = c.v; |
586 elem.a = 1; byte val1 = get(); byte val2 = get1(); |
586 elem.a = 1; byte val1 = get(); byte val2 = get1(); |
587 elem.a = 2; byte val3 = get(); byte val4 = get1(); |
587 elem.a = 2; byte val3 = get(); byte val4 = get1(); |
588 |
588 |
589 assertEquals(val1, 1); |
589 assertEquals(val1, 1); |
590 assertEquals(val3, (isStableEnabled ? 1 : 2)); |
590 assertEquals(val3, (isStableEnabled ? 1 : 2)); |
591 |
591 |
592 assertEquals(val2, 1); |
592 assertEquals(val2, 1); |