Skip to content

Commit

Permalink
Remove driver.c.
Browse files Browse the repository at this point in the history
  • Loading branch information
rui314 committed Mar 13, 2012
1 parent 68ae99d commit dcc0795
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 13 deletions.
8 changes: 0 additions & 8 deletions driver.c

This file was deleted.

2 changes: 0 additions & 2 deletions lex.c
Expand Up @@ -3,8 +3,6 @@
#include <ctype.h>
#include "8cc.h"

#define BUFLEN 256

static Token *ungotten = NULL;

static Token *make_ident(String *s) {
Expand Down
5 changes: 2 additions & 3 deletions test.sh
Expand Up @@ -6,7 +6,7 @@ function compile {
echo "Failed to compile $1"
exit
fi
gcc -o tmp.out driver.c tmp.s
gcc -o tmp.out tmp.s
if [ $? -ne 0 ]; then
echo "GCC failed: $1"
exit
Expand Down Expand Up @@ -34,7 +34,7 @@ function testast {
}

function testf {
compile "$2"
compile "int main(){printf(\"%d\",f());} $2"
assertequal "$(./tmp.out)" "$1"
}

Expand Down Expand Up @@ -183,7 +183,6 @@ test 31 'int a=31;{int a=64;}a;'
test 64 'int a=31;{int a=64;a;}'

# Function parameter
testf '102' 'int f(int n){n;}'
testf 77 'int g(){77;} int f(){g();}'
testf 79 'int g(int a){a;} int f(){g(79);}'
testf 21 'int g(int a,int b,int c,int d,int e,int f){a+b+c+d+e+f;} int f(){g(1,2,3,4,5,6);}'
Expand Down

0 comments on commit dcc0795

Please sign in to comment.