Skip to content

Commit

Permalink
Add 8cc compiler to test suit
Browse files Browse the repository at this point in the history
  • Loading branch information
Frky committed Jun 2, 2017
1 parent a0426e8 commit 80e0580
Show file tree
Hide file tree
Showing 108 changed files with 43,706 additions and 8 deletions.
4 changes: 4 additions & 0 deletions src/pintool/arity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,18 +170,22 @@ VOID fn_ret() {
if (!call_stack.is_top_forgotten()) {
while (is_jump_stack.top()) {
// std::cerr << "unjumping" << endl;
#if 0
if (reg_maybe_return[REGF_AX])
nb_ret_int[call_stack.top()]++;
else if (reg_maybe_return[REGF_XMM0])
nb_ret_float[call_stack.top()]++;
#endif
call_stack.pop();
is_jump_stack.pop();
sp_stack.pop();
}
#if 0
if (reg_maybe_return[REGF_AX])
nb_ret_int[call_stack.top()]++;
else if (reg_maybe_return[REGF_XMM0])
nb_ret_float[call_stack.top()]++;
#endif
call_stack.pop();
is_jump_stack.pop();
sp_stack.pop();
Expand Down
258 changes: 258 additions & 0 deletions test/8cc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,258 @@
8cc-1:
args: "-w -o test/tmp/a.out -c ./test/input/8cc/lex.c"
bin: "test/bin/8cc/8cc-1"
data: "test/data/8cc.data"
deps: "test/data/8cc.deps"
post: "rm test/tmp/a.out"
8cc-2:
args: "-w -o test/tmp/a.out -c ./test/input/8cc/extern.c"
bin: "test/bin/8cc/8cc-2"
data: "test/data/8cc.data"
deps: "test/data/8cc.deps"
post: "rm test/tmp/a.out"
8cc-3:
args: "-w -o test/tmp/a.out -c ./test/input/8cc/union.c"
bin: "test/bin/8cc/8cc-3"
data: "test/data/8cc.data"
deps: "test/data/8cc.deps"
post: "rm test/tmp/a.out"
8cc-4:
args: "-w -o test/tmp/a.out -c ./test/input/8cc/cast.c"
bin: "test/bin/8cc/8cc-4"
data: "test/data/8cc.data"
deps: "test/data/8cc.deps"
post: "rm test/tmp/a.out"
8cc-5:
args: "-w -o test/tmp/a.out -c ./test/input/8cc/funcargs.c"
bin: "test/bin/8cc/8cc-5"
data: "test/data/8cc.data"
deps: "test/data/8cc.deps"
post: "rm test/tmp/a.out"
8cc-6:
args: "-w -o test/tmp/a.out -c ./test/input/8cc/conversion.c"
bin: "test/bin/8cc/8cc-6"
data: "test/data/8cc.data"
deps: "test/data/8cc.deps"
post: "rm test/tmp/a.out"
8cc-7:
args: "-w -o test/tmp/a.out -c ./test/input/8cc/noreturn.c"
bin: "test/bin/8cc/8cc-7"
data: "test/data/8cc.data"
deps: "test/data/8cc.deps"
post: "rm test/tmp/a.out"
8cc-8:
args: "-w -o test/tmp/a.out -c ./test/input/8cc/initializer.c"
bin: "test/bin/8cc/8cc-8"
data: "test/data/8cc.data"
deps: "test/data/8cc.deps"
post: "rm test/tmp/a.out"
8cc-9:
args: "-w -o test/tmp/a.out -c ./test/input/8cc/align.c"
bin: "test/bin/8cc/8cc-9"
data: "test/data/8cc.data"
deps: "test/data/8cc.deps"
post: "rm test/tmp/a.out"
8cc-10:
args: "-w -o test/tmp/a.out -c ./test/input/8cc/array.c"
bin: "test/bin/8cc/8cc-10"
data: "test/data/8cc.data"
deps: "test/data/8cc.deps"
post: "rm test/tmp/a.out"
8cc-11:
args: "-w -o test/tmp/a.out -c ./test/input/8cc/float.c"
bin: "test/bin/8cc/8cc-11"
data: "test/data/8cc.data"
deps: "test/data/8cc.deps"
post: "rm test/tmp/a.out"
8cc-12:
args: "-w -o test/tmp/a.out -c ./test/input/8cc/int.c"
bin: "test/bin/8cc/8cc-12"
data: "test/data/8cc.data"
deps: "test/data/8cc.deps"
post: "rm test/tmp/a.out"
8cc-13:
args: "-w -o test/tmp/a.out -c ./test/input/8cc/number.c"
bin: "test/bin/8cc/8cc-13"
data: "test/data/8cc.data"
deps: "test/data/8cc.deps"
post: "rm test/tmp/a.out"
8cc-14:
args: "-w -o test/tmp/a.out -c ./test/input/8cc/usualconv.c"
bin: "test/bin/8cc/8cc-14"
data: "test/data/8cc.data"
deps: "test/data/8cc.deps"
post: "rm test/tmp/a.out"
8cc-15:
args: "-w -o test/tmp/a.out -c ./test/input/8cc/scope.c"
bin: "test/bin/8cc/8cc-15"
data: "test/data/8cc.data"
deps: "test/data/8cc.deps"
post: "rm test/tmp/a.out"
8cc-16:
args: "-w -o test/tmp/a.out -c ./test/input/8cc/sizeof.c"
bin: "test/bin/8cc/8cc-16"
data: "test/data/8cc.data"
deps: "test/data/8cc.deps"
post: "rm test/tmp/a.out"
8cc-17:
args: "-w -o test/tmp/a.out -c ./test/input/8cc/import.c"
bin: "test/bin/8cc/8cc-17"
data: "test/data/8cc.data"
deps: "test/data/8cc.deps"
post: "rm test/tmp/a.out"
8cc-18:
args: "-w -o test/tmp/a.out -c ./test/input/8cc/bitop.c"
bin: "test/bin/8cc/8cc-18"
data: "test/data/8cc.data"
deps: "test/data/8cc.deps"
post: "rm test/tmp/a.out"
8cc-19:
args: "-w -o test/tmp/a.out -c ./test/input/8cc/testmain.c"
bin: "test/bin/8cc/8cc-19"
data: "test/data/8cc.data"
deps: "test/data/8cc.deps"
post: "rm test/tmp/a.out"
8cc-20:
args: "-w -o test/tmp/a.out -c ./test/input/8cc/constexpr.c"
bin: "test/bin/8cc/8cc-20"
data: "test/data/8cc.data"
deps: "test/data/8cc.deps"
post: "rm test/tmp/a.out"
8cc-21:
args: "-w -o test/tmp/a.out -c ./test/input/8cc/literal.c"
bin: "test/bin/8cc/8cc-21"
data: "test/data/8cc.data"
deps: "test/data/8cc.deps"
post: "rm test/tmp/a.out"
8cc-22:
args: "-w -o test/tmp/a.out -c ./test/input/8cc/staticassert.c"
bin: "test/bin/8cc/8cc-22"
data: "test/data/8cc.data"
deps: "test/data/8cc.deps"
post: "rm test/tmp/a.out"
8cc-23:
args: "-w -o test/tmp/a.out -c ./test/input/8cc/builtin.c"
bin: "test/bin/8cc/8cc-23"
data: "test/data/8cc.data"
deps: "test/data/8cc.deps"
post: "rm test/tmp/a.out"
8cc-24:
args: "-w -o test/tmp/a.out -c ./test/input/8cc/enum.c"
bin: "test/bin/8cc/8cc-24"
data: "test/data/8cc.data"
deps: "test/data/8cc.deps"
post: "rm test/tmp/a.out"
8cc-25:
args: "-w -o test/tmp/a.out -c ./test/input/8cc/typeof.c"
bin: "test/bin/8cc/8cc-25"
data: "test/data/8cc.data"
deps: "test/data/8cc.deps"
post: "rm test/tmp/a.out"
8cc-26:
args: "-w -o test/tmp/a.out -c ./test/input/8cc/macro.c"
bin: "test/bin/8cc/8cc-26"
data: "test/data/8cc.data"
deps: "test/data/8cc.deps"
post: "rm test/tmp/a.out"
8cc-27:
args: "-w -o test/tmp/a.out -c ./test/input/8cc/stmtexpr.c"
bin: "test/bin/8cc/8cc-27"
data: "test/data/8cc.data"
deps: "test/data/8cc.deps"
post: "rm test/tmp/a.out"
8cc-28:
args: "-w -o test/tmp/a.out -c ./test/input/8cc/varargs.c"
bin: "test/bin/8cc/8cc-28"
data: "test/data/8cc.data"
deps: "test/data/8cc.deps"
post: "rm test/tmp/a.out"
8cc-29:
args: "-w -o test/tmp/a.out -c ./test/input/8cc/assign.c"
bin: "test/bin/8cc/8cc-29"
data: "test/data/8cc.data"
deps: "test/data/8cc.deps"
post: "rm test/tmp/a.out"
8cc-30:
args: "-w -o test/tmp/a.out -c ./test/input/8cc/arith.c"
bin: "test/bin/8cc/8cc-30"
data: "test/data/8cc.data"
deps: "test/data/8cc.deps"
post: "rm test/tmp/a.out"
8cc-31:
args: "-w -o test/tmp/a.out -c ./test/input/8cc/type.c"
bin: "test/bin/8cc/8cc-31"
data: "test/data/8cc.data"
deps: "test/data/8cc.deps"
post: "rm test/tmp/a.out"
8cc-32:
args: "-w -o test/tmp/a.out -c ./test/input/8cc/global.c"
bin: "test/bin/8cc/8cc-32"
data: "test/data/8cc.data"
deps: "test/data/8cc.deps"
post: "rm test/tmp/a.out"
8cc-33:
args: "-w -o test/tmp/a.out -c ./test/input/8cc/struct.c"
bin: "test/bin/8cc/8cc-33"
data: "test/data/8cc.data"
deps: "test/data/8cc.deps"
post: "rm test/tmp/a.out"
8cc-34:
args: "-w -o test/tmp/a.out -c ./test/input/8cc/control.c"
bin: "test/bin/8cc/8cc-34"
data: "test/data/8cc.data"
deps: "test/data/8cc.deps"
post: "rm test/tmp/a.out"
8cc-35:
args: "-w -o test/tmp/a.out -c ./test/input/8cc/includeguard.c"
bin: "test/bin/8cc/8cc-35"
data: "test/data/8cc.data"
deps: "test/data/8cc.deps"
post: "rm test/tmp/a.out"
8cc-36:
args: "-w -o test/tmp/a.out -c ./test/input/8cc/oldstyle.c"
bin: "test/bin/8cc/8cc-36"
data: "test/data/8cc.data"
deps: "test/data/8cc.deps"
post: "rm test/tmp/a.out"
8cc-37:
args: "-w -o test/tmp/a.out -c ./test/input/8cc/iso646.c"
bin: "test/bin/8cc/8cc-37"
data: "test/data/8cc.data"
deps: "test/data/8cc.deps"
post: "rm test/tmp/a.out"
8cc-38:
args: "-w -o test/tmp/a.out -c ./test/input/8cc/comp.c"
bin: "test/bin/8cc/8cc-38"
data: "test/data/8cc.data"
deps: "test/data/8cc.deps"
post: "rm test/tmp/a.out"
8cc-39:
args: "-w -o test/tmp/a.out -c ./test/input/8cc/pointer.c"
bin: "test/bin/8cc/8cc-39"
data: "test/data/8cc.data"
deps: "test/data/8cc.deps"
post: "rm test/tmp/a.out"
8cc-40:
args: "-w -o test/tmp/a.out -c ./test/input/8cc/function.c"
bin: "test/bin/8cc/8cc-40"
data: "test/data/8cc.data"
deps: "test/data/8cc.deps"
post: "rm test/tmp/a.out"
8cc-41:
args: "-w -o test/tmp/a.out -c ./test/input/8cc/generic.c"
bin: "test/bin/8cc/8cc-41"
data: "test/data/8cc.data"
deps: "test/data/8cc.deps"
post: "rm test/tmp/a.out"
8cc-42:
args: "-w -o test/tmp/a.out -c ./test/input/8cc/decl.c"
bin: "test/bin/8cc/8cc-42"
data: "test/data/8cc.data"
deps: "test/data/8cc.deps"
post: "rm test/tmp/a.out"
8cc-43:
args: "-w -o test/tmp/a.out -c ./test/input/8cc/line.c"
bin: "test/bin/8cc/8cc-43"
data: "test/data/8cc.data"
deps: "test/data/8cc.deps"
post: "rm test/tmp/a.out"
Binary file added test/bin/8cc/8cc
Binary file not shown.
Binary file added test/bin/8cc/8cc-1
Binary file not shown.
Binary file added test/bin/8cc/8cc-10
Binary file not shown.
Binary file added test/bin/8cc/8cc-11
Binary file not shown.
Binary file added test/bin/8cc/8cc-12
Binary file not shown.
Binary file added test/bin/8cc/8cc-13
Binary file not shown.
Binary file added test/bin/8cc/8cc-14
Binary file not shown.
Binary file added test/bin/8cc/8cc-15
Binary file not shown.
Binary file added test/bin/8cc/8cc-16
Binary file not shown.
Binary file added test/bin/8cc/8cc-17
Binary file not shown.
Binary file added test/bin/8cc/8cc-18
Binary file not shown.
Binary file added test/bin/8cc/8cc-19
Binary file not shown.
Binary file added test/bin/8cc/8cc-2
Binary file not shown.
Binary file added test/bin/8cc/8cc-20
Binary file not shown.
Binary file added test/bin/8cc/8cc-21
Binary file not shown.
Binary file added test/bin/8cc/8cc-22
Binary file not shown.
Binary file added test/bin/8cc/8cc-23
Binary file not shown.
Binary file added test/bin/8cc/8cc-24
Binary file not shown.
Binary file added test/bin/8cc/8cc-25
Binary file not shown.
Binary file added test/bin/8cc/8cc-26
Binary file not shown.
Binary file added test/bin/8cc/8cc-27
Binary file not shown.
Binary file added test/bin/8cc/8cc-28
Binary file not shown.
Binary file added test/bin/8cc/8cc-29
Binary file not shown.
Binary file added test/bin/8cc/8cc-3
Binary file not shown.
Binary file added test/bin/8cc/8cc-30
Binary file not shown.
Binary file added test/bin/8cc/8cc-31
Binary file not shown.
Binary file added test/bin/8cc/8cc-32
Binary file not shown.
Binary file added test/bin/8cc/8cc-33
Binary file not shown.
Binary file added test/bin/8cc/8cc-34
Binary file not shown.
Binary file added test/bin/8cc/8cc-35
Binary file not shown.
Binary file added test/bin/8cc/8cc-36
Binary file not shown.
Binary file added test/bin/8cc/8cc-37
Binary file not shown.
Binary file added test/bin/8cc/8cc-38
Binary file not shown.
Binary file added test/bin/8cc/8cc-39
Binary file not shown.
Binary file added test/bin/8cc/8cc-4
Binary file not shown.
Binary file added test/bin/8cc/8cc-40
Binary file not shown.
Binary file added test/bin/8cc/8cc-41
Binary file not shown.
Binary file added test/bin/8cc/8cc-42
Binary file not shown.
Binary file added test/bin/8cc/8cc-43
Binary file not shown.
Binary file added test/bin/8cc/8cc-5
Binary file not shown.
Binary file added test/bin/8cc/8cc-6
Binary file not shown.
Binary file added test/bin/8cc/8cc-7
Binary file not shown.
Binary file added test/bin/8cc/8cc-8
Binary file not shown.
Binary file added test/bin/8cc/8cc-9
Binary file not shown.
Loading

0 comments on commit 80e0580

Please sign in to comment.