Skip to content

Commit 32a410e

Browse files
committed
Add additional regression tests for the memory analyzer
1 parent 9c2d9d3 commit 32a410e

File tree

36 files changed

+406
-0
lines changed

36 files changed

+406
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
void checkpoint()
2+
{
3+
}
4+
5+
int array[] = {1, 2, 3};
6+
7+
int main()
8+
{
9+
array[1] = 4;
10+
11+
checkpoint();
12+
13+
return 0;
14+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
CORE
2+
main.exe
3+
--breakpoint checkpoint --symbols array
4+
array = \{ 1, 4, 3 \};
5+
^EXIT=0$
6+
^SIGNAL=0$
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
void checkpoint()
2+
{
3+
}
4+
5+
int x = 3;
6+
int *p = &x;
7+
8+
struct S
9+
{
10+
int c1;
11+
int c2;
12+
};
13+
14+
struct S st = {.c1 = 1, .c2 = 2};
15+
16+
int a[] = {1, 2, 3};
17+
18+
int main()
19+
{
20+
checkpoint();
21+
22+
return 0;
23+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
CORE
2+
main.exe
3+
--breakpoint checkpoint --symbols x,p,st,a --symtab-snapshot --json-ui
4+
^EXIT=0$
5+
^SIGNAL=0$
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
void checkpoint()
2+
{
3+
}
4+
5+
int x = 3;
6+
int *p = &x;
7+
8+
int main()
9+
{
10+
checkpoint();
11+
12+
return 0;
13+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CORE
2+
main.exe
3+
--breakpoint checkpoint --symbols x,p
4+
x = 3;
5+
p = &x;
6+
^EXIT=0$
7+
^SIGNAL=0$
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
void checkpoint()
2+
{
3+
}
4+
5+
int x = 3;
6+
int *p = &x;
7+
8+
int main()
9+
{
10+
checkpoint();
11+
12+
return 0;
13+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
CORE
2+
main.exe
3+
--breakpoint checkpoint --symbols p,x
4+
^EXIT=0$
5+
^SIGNAL=0$
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
void checkpoint()
2+
{
3+
}
4+
5+
int x = 3;
6+
void *p = (void *)&x;
7+
8+
int main()
9+
{
10+
checkpoint();
11+
12+
return 0;
13+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CORE
2+
main.exe
3+
--breakpoint checkpoint --symbols x,p
4+
x = 3;
5+
p = &x;
6+
^EXIT=0$
7+
^SIGNAL=0$
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
void checkpoint()
2+
{
3+
}
4+
5+
int x = 3;
6+
int *p1 = &x;
7+
int **p2 = &p1;
8+
9+
int main()
10+
{
11+
checkpoint();
12+
13+
return 0;
14+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
CORE
2+
main.exe
3+
--breakpoint checkpoint --symbols x,p1,p2
4+
^EXIT=0$
5+
^SIGNAL=0$
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
void checkpoint()
2+
{
3+
}
4+
5+
int x = 3;
6+
int *p1 = &x;
7+
int *p2 = &x;
8+
9+
int main()
10+
{
11+
checkpoint();
12+
13+
return 0;
14+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
CORE
2+
main.exe
3+
--breakpoint checkpoint --symbols p1,x,p2
4+
^EXIT=0$
5+
^SIGNAL=0$
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
void checkpoint()
2+
{
3+
}
4+
5+
int x = 3;
6+
void *p = (void *)&x;
7+
8+
int main()
9+
{
10+
checkpoint();
11+
12+
return 0;
13+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
CORE
2+
main.exe
3+
--breakpoint checkpoint --symbols p,x
4+
^EXIT=0$
5+
^SIGNAL=0$
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
void checkpoint()
2+
{
3+
}
4+
5+
int x = 3;
6+
int *p = &x;
7+
8+
int main()
9+
{
10+
checkpoint();
11+
12+
return 0;
13+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
CORE
2+
main.exe
3+
--breakpoint checkpoint --symbols p
4+
^EXIT=0$
5+
^SIGNAL=0$
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
void checkpoint()
2+
{
3+
}
4+
5+
int x = 3;
6+
void *p = (void *)&x;
7+
8+
int main()
9+
{
10+
checkpoint();
11+
12+
return 0;
13+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
KNOWNBUG
2+
main.exe
3+
--breakpoint checkpoint --symbols p
4+
^EXIT=0$
5+
^SIGNAL=0$
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
void checkpoint()
2+
{
3+
}
4+
5+
struct S
6+
{
7+
struct S *next;
8+
};
9+
10+
struct S st;
11+
struct S *p;
12+
13+
int main()
14+
{
15+
st.next = &st;
16+
p = &st;
17+
18+
checkpoint();
19+
20+
return 0;
21+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CORE
2+
main.exe
3+
--breakpoint checkpoint --symbols p
4+
struct S tmp;
5+
tmp = \{ \.next=\(\(struct S \*\)NULL\) \};
6+
p = &tmp;
7+
p->next = &tmp;
8+
^EXIT=0$
9+
^SIGNAL=0$
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
void checkpoint()
2+
{
3+
}
4+
5+
const char *s = "abc";
6+
7+
int main()
8+
{
9+
checkpoint();
10+
11+
return 0;
12+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
KNOWNBUG
2+
main.exe
3+
--breakpoint checkpoint --symbols s
4+
char tmp\[4\];
5+
tmp = "abc";
6+
s = tmp;
7+
^EXIT=0$
8+
^SIGNAL=0$
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
void checkpoint()
2+
{
3+
}
4+
5+
struct S
6+
{
7+
int c1;
8+
int c2;
9+
};
10+
11+
struct S st = {1, 2};
12+
13+
int main()
14+
{
15+
st.c2 = 3;
16+
17+
checkpoint();
18+
19+
return 0;
20+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
CORE
2+
main.exe
3+
--breakpoint checkpoint --symbols st
4+
st = \{ .c1=1, .c2=3 \};
5+
^EXIT=0$
6+
^SIGNAL=0$
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
void checkpoint()
2+
{
3+
}
4+
5+
struct S
6+
{
7+
int c1;
8+
int *c2;
9+
};
10+
11+
int i = 0;
12+
struct S st = {1, &i};
13+
14+
int main()
15+
{
16+
i = 3;
17+
18+
checkpoint();
19+
20+
return 0;
21+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
main.exe
3+
--breakpoint checkpoint --symbols st
4+
signed int tmp;
5+
tmp = 3;
6+
st = \{ .c1=1, .c2=&tmp \};
7+
^EXIT=0$
8+
^SIGNAL=0$
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
void checkpoint()
2+
{
3+
}
4+
5+
struct S
6+
{
7+
int c1;
8+
char *c2;
9+
};
10+
11+
struct S st = {1, "abc"};
12+
13+
int main()
14+
{
15+
checkpoint();
16+
17+
return 0;
18+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
KNOWNBUG
2+
main.exe
3+
--breakpoint checkpoint --symbols st
4+
char tmp[4];
5+
tmp = "abc";
6+
st = \{ .c1=1, .c2=tmp \};
7+
^EXIT=0$
8+
^SIGNAL=0$
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
void checkpoint()
2+
{
3+
}
4+
5+
struct S
6+
{
7+
int c1;
8+
char c2;
9+
};
10+
11+
struct S st = {1, 'x'};
12+
13+
int main()
14+
{
15+
checkpoint();
16+
17+
return 0;
18+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
KNOWNBUG
2+
main.exe
3+
--breakpoint checkpoint --symbols st
4+
st = \{ .c1=1, .c2='x' \};
5+
^EXIT=0$
6+
^SIGNAL=0$

0 commit comments

Comments
 (0)