Skip to content

Commit 08cf4ee

Browse files
author
thk123
committed
Added initial collection of tests for typedef'd types
Covers the basic cases of typedef-ing a normal type (int)
1 parent 35356bd commit 08cf4ee

File tree

8 files changed

+107
-0
lines changed

8 files changed

+107
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
default: tests.log
3+
4+
test:
5+
@if ! ../test.pl -c ../chain.sh ; then \
6+
../failed-tests-printer.pl ; \
7+
exit 1; \
8+
fi
9+
10+
tests.log:
11+
@if ! ../test.pl -c ../chain.sh ; then \
12+
../failed-tests-printer.pl ; \
13+
exit 1; \
14+
fi
15+
16+
show:
17+
@for dir in *; do \
18+
if [ -d "$$dir" ]; then \
19+
vim -o "$$dir/*.c" "$$dir/*.out"; \
20+
fi; \
21+
done;
22+
23+
clean:
24+
@for dir in *; do \
25+
rm -f tests.log; \
26+
if [ -d "$$dir" ]; then \
27+
cd "$$dir"; \
28+
rm -f *.out *.gb; \
29+
cd ..; \
30+
fi \
31+
done
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
SRC=../../../src
4+
5+
GC=$SRC/goto-cc/goto-cc
6+
GI=$SRC/goto-instrument/goto-instrument
7+
8+
OPTS=$1
9+
NAME=${2%.c}
10+
11+
$GC $NAME.c --function fun -o $NAME.gb
12+
echo $GI $OPTS $NAME.gb
13+
$GI $OPTS $NAME.gb
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
typedef int MYINT;
3+
4+
void fun()
5+
{
6+
int int_var = 3;
7+
MYINT myint_var = 5;
8+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
CORE
2+
main.c
3+
"--show-symbol-table"
4+
// Enable multi-line checking
5+
activate-multi-line-match
6+
EXIT=0
7+
SIGNAL=0
8+
Base name\.+: int_var\nMode\.+: C\nType\.+: signed int
9+
Base name\.+: myint_var\nMode\.+: C\nType\.+: MYINT
10+
--
11+
warning: ignoring
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
typedef int MYINT;
3+
typedef int ALTINT;
4+
5+
void fun()
6+
{
7+
int int_var = 3;
8+
MYINT myint_var = 5;
9+
ALTINT altint_var = 7;
10+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
CORE
2+
main.c
3+
"--show-symbol-table"
4+
// Enable multi-line checking
5+
activate-multi-line-match
6+
EXIT=0
7+
SIGNAL=0
8+
Base name\.+: int_var\nMode\.+: C\nType\.+: signed int
9+
Base name\.+: myint_var\nMode\.+: C\nType\.+: MYINT
10+
Base name\.+: altint_var\nMode\.+: C\nType\.+: ALTINT
11+
--
12+
warning: ignoring
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
typedef int MYINT;
3+
typedef MYINT CHAINEDINT;
4+
5+
void fun()
6+
{
7+
int int_var = 3;
8+
MYINT myint_var = 5;
9+
CHAINEDINT chainedint_var = 5;
10+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
CORE
2+
main.c
3+
"--show-symbol-table"
4+
// Enable multi-line checking
5+
activate-multi-line-match
6+
EXIT=0
7+
SIGNAL=0
8+
Base name\.+: int_var\nMode\.+: C\nType\.+: signed int
9+
Base name\.+: myint_var\nMode\.+: C\nType\.+: MYINT
10+
Base name\.+: chainedint_var\nMode\.+: C\nType\.+: CHAINEDINT
11+
--
12+
warning: ignoring

0 commit comments

Comments
 (0)