aboutsummaryrefslogtreecommitdiffstats
path: root/c_compiler/test
diff options
context:
space:
mode:
authorymherklotz <ymherklotz@gmail.com>2017-03-10 15:23:46 +0000
committerymherklotz <ymherklotz@gmail.com>2017-03-10 15:23:46 +0000
commitb751d9ade81f47d75a5dc16f40890f30a6a1d1c5 (patch)
treed2ff52856eff330ad2b9df60d88884c2a73569e1 /c_compiler/test
parent21c873789eda041f7004d12637be3f3ed6f4cebc (diff)
downloadCompiler-b751d9ade81f47d75a5dc16f40890f30a6a1d1c5.tar.gz
Compiler-b751d9ade81f47d75a5dc16f40890f30a6a1d1c5.zip
Got variables and bindings kind of working
Diffstat (limited to 'c_compiler/test')
-rw-r--r--c_compiler/test/in/01.c3
-rw-r--r--c_compiler/test/in/02.c4
-rw-r--r--c_compiler/test/in/03.c5
-rwxr-xr-xc_compiler/test/out/03bin672108 -> 672108 bytes
-rw-r--r--c_compiler/test/out/03.s3
-rwxr-xr-xc_compiler/test/out/04bin676220 -> 676220 bytes
-rw-r--r--c_compiler/test/out/04.s5
-rw-r--r--c_compiler/test/out/04.stderr.txt1
8 files changed, 9 insertions, 12 deletions
diff --git a/c_compiler/test/in/01.c b/c_compiler/test/in/01.c
deleted file mode 100644
index c362948..0000000
--- a/c_compiler/test/in/01.c
+++ /dev/null
@@ -1,3 +0,0 @@
-int main() {
- return 13;
-}
diff --git a/c_compiler/test/in/02.c b/c_compiler/test/in/02.c
deleted file mode 100644
index 95c954c..0000000
--- a/c_compiler/test/in/02.c
+++ /dev/null
@@ -1,4 +0,0 @@
-int main() {
- int x = 26;
- return x;
-}
diff --git a/c_compiler/test/in/03.c b/c_compiler/test/in/03.c
deleted file mode 100644
index 911f7e2..0000000
--- a/c_compiler/test/in/03.c
+++ /dev/null
@@ -1,5 +0,0 @@
-int main() {
- int x;
- x = 15;
- return x;
-}
diff --git a/c_compiler/test/out/03 b/c_compiler/test/out/03
index a020bfc..9a997cd 100755
--- a/c_compiler/test/out/03
+++ b/c_compiler/test/out/03
Binary files differ
diff --git a/c_compiler/test/out/03.s b/c_compiler/test/out/03.s
index eae78d0..b1071cb 100644
--- a/c_compiler/test/out/03.s
+++ b/c_compiler/test/out/03.s
@@ -4,6 +4,9 @@ main:
addiu $sp,$sp,-12
sw $fp,8($sp)
move $fp,$sp
+ move $2,$0
+ sw $2,4($fp)
+ lw $2,4($fp)
move $sp,$fp
lw $fp,8($sp)
addiu $sp,$sp,12
diff --git a/c_compiler/test/out/04 b/c_compiler/test/out/04
index a23dad4..e50b1ae 100755
--- a/c_compiler/test/out/04
+++ b/c_compiler/test/out/04
Binary files differ
diff --git a/c_compiler/test/out/04.s b/c_compiler/test/out/04.s
index 992f12a..a91af30 100644
--- a/c_compiler/test/out/04.s
+++ b/c_compiler/test/out/04.s
@@ -4,6 +4,11 @@ main:
addiu $sp,$sp,-16
sw $fp,12($sp)
move $fp,$sp
+ li $2,3
+ sw $2,4($fp)
+ li $2,5
+ sw $2,8($fp)
+ lw $2,8($fp)
move $sp,$fp
lw $fp,12($sp)
addiu $sp,$sp,16
diff --git a/c_compiler/test/out/04.stderr.txt b/c_compiler/test/out/04.stderr.txt
index e69de29..e585698 100644
--- a/c_compiler/test/out/04.stderr.txt
+++ b/c_compiler/test/out/04.stderr.txt
@@ -0,0 +1 @@
+Can't find identifier 'v' in current scope binding