Skip to content

Commit cfcb6b1

Browse files
committed
Option --replace-calls to replace function calls with calls to other given functions
1 parent 61a8c30 commit cfcb6b1

File tree

19 files changed

+395
-1
lines changed

19 files changed

+395
-1
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#include <assert.h>
2+
3+
int f(int a)
4+
{
5+
return a;
6+
}
7+
8+
int g(int b)
9+
{
10+
return b + 1;
11+
}
12+
13+
int main()
14+
{
15+
int r;
16+
17+
r = f(0);
18+
assert(r == 1);
19+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
main.c
3+
--replace-calls f:g
4+
^VERIFICATION SUCCESSFUL$
5+
^EXIT=0$
6+
^SIGNAL=0$
7+
--
8+
^warning: ignoring
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
2+
int f(int a)
3+
{
4+
return a;
5+
}
6+
7+
int g(int b)
8+
{
9+
return b + 1;
10+
}
11+
12+
int main()
13+
{
14+
int r;
15+
16+
r = f(0);
17+
assert(r == 1);
18+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
CORE
2+
main.c
3+
--replace-calls f:g
4+
g\(0\);
5+
^VERIFICATION SUCCESSFUL$
6+
^EXIT=0$
7+
^SIGNAL=0$
8+
--
9+
f\(0\);
10+
^warning: ignoring
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
int f()
3+
{
4+
return 0;
5+
}
6+
7+
int g()
8+
{
9+
return 1;
10+
}
11+
12+
int h()
13+
{
14+
return 2;
15+
}
16+
17+
int i()
18+
{
19+
return 3;
20+
}
21+
22+
int main()
23+
{
24+
int r;
25+
26+
r = f();
27+
assert(r == 1);
28+
29+
r = h();
30+
assert(r == 3);
31+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
CORE
2+
main.c
3+
--replace-calls f:g --replace-calls h:i
4+
g\(\);
5+
i\(\);
6+
^VERIFICATION SUCCESSFUL$
7+
^EXIT=0$
8+
^SIGNAL=0$
9+
--
10+
f\(\);
11+
h\(\);
12+
^warning: ignoring
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
int f()
3+
{
4+
return 0;
5+
}
6+
7+
char g()
8+
{
9+
return 1;
10+
}
11+
12+
int main()
13+
{
14+
f();
15+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
main.c
3+
--replace-calls f:g
4+
Functions f and g are not type-compatible
5+
^EXIT=11$
6+
^SIGNAL=0$
7+
--
8+
^warning: ignoring
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
void f(int a)
3+
{
4+
return 0;
5+
}
6+
7+
void g(unsigned a)
8+
{
9+
return 1;
10+
}
11+
12+
int main()
13+
{
14+
f(0);
15+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
main.c
3+
--replace-calls f:g
4+
Functions f and g are not type-compatible
5+
^EXIT=11$
6+
^SIGNAL=0$
7+
--
8+
^warning: ignoring

0 commit comments

Comments
 (0)