01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: package org.apache.harmony.drlvm.tests.regression.h3175;
19:
20: import junit.framework.TestCase;
21:
22: public class Test extends TestCase {
23:
24: static int i1, i2;
25: static byte[] b1, b2;
26:
27: public void testSwitch1() throws Exception {
28: blit();
29: }
30:
31: static void blit() {
32: int dp = 0;
33: switch (i1) {
34: case 1:
35: dp = 0;
36: break;
37: case 7:
38: break;
39: case 6:
40: break;
41: case 2:
42: break;
43: }
44: }
45:
46: public void testSwitch2() throws Exception {
47: blit2();
48: }
49:
50: static void blit2() {
51: byte[] destData = b2;
52: byte[] alphaData = b1;
53: int dtype = i1;
54: int destAlphaShift = i2;
55: int alpha = 0;
56: int dy = 0;
57: for (; dy > 0; --dy) {
58: switch (dy) {
59: case 3:
60: dy = destData[0];
61: break;
62: case 8:
63: dy = 0;
64: break;
65: case 2:
66: dy = 0;
67: break;
68: case 5:
69: int i = 0;
70: while (i < alpha) {
71: if ((i == alphaData[0]) && (i == alphaData[2])) {
72: }
73: }
74: break;
75: }
76: final int data = 0 << destAlphaShift;
77: switch (dtype) {
78: case 1:
79: alpha = data;
80: break;
81: case 4:
82: destData[0] = 0;
83: case 5:
84: destData[1] = (byte) data;
85: break;
86: }
87: }
88: }
89: }
|