Skip to content

Commit 7fe27bd

Browse files
committed
Add tests for local variable live ranges with holes
Both of these feature local variables that are declared in the class file LVT with two or more live ranges, because of initialisation by a try/catch or the cases of a switch statement. The tests assert that the initialisation is as expected, to catch cases where the two live ranges are erroneously treated seperately and so the variable read in the assertion is an effective nondet.
1 parent 3de6faa commit 7fe27bd

File tree

6 files changed

+58
-0
lines changed

6 files changed

+58
-0
lines changed
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
2+
public class live_range_with_holes {
3+
4+
public static void main(int arg) {
5+
6+
int x;
7+
int y;
8+
switch(arg) {
9+
case 1:
10+
x = 1;
11+
y = 1;
12+
break;
13+
case 2:
14+
x = 2;
15+
y = 2;
16+
break;
17+
default:
18+
x = 0;
19+
y = 0;
20+
break;
21+
}
22+
assert(x >= 0 && x <= 2);
23+
24+
}
25+
26+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CORE
2+
live_range_with_holes.class
3+
--function live_range_with_holes.main
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
^VERIFICATION SUCCESSFUL$
7+
--
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
2+
public class live_range_exception {
3+
public static void main() {
4+
int x;
5+
int y;
6+
try
7+
{
8+
x = 0;
9+
y = 0;
10+
}
11+
catch(Exception e)
12+
{
13+
x = 1;
14+
y = 1;
15+
}
16+
assert(x==0 || x==1);
17+
}
18+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CORE
2+
live_range_exception.class
3+
--function live_range_exception.main
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
^VERIFICATION SUCCESSFUL$
7+
--

0 commit comments

Comments
 (0)