aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Herklotz <ymherklotz@gmail.com>2017-03-10 21:23:53 +0000
committerYann Herklotz <ymherklotz@gmail.com>2017-03-10 21:23:53 +0000
commit7606b62bc81fd8ea55a6a65104be273f954e70c1 (patch)
tree268376c7926f6dbe4fd2f98df30c3e00d8018314
parentd7a31b4cbcc50c46ff3ea671e120d29c68d36795 (diff)
downloadCompiler-7606b62bc81fd8ea55a6a65104be273f954e70c1.tar.gz
Compiler-7606b62bc81fd8ea55a6a65104be273f954e70c1.zip
Changed simple test case
-rw-r--r--c_compiler/test/in/SimpleAdd_2.c8
-rwxr-xr-xc_compiler/test/out/ComplexAssignmentbin0 -> 676204 bytes
-rw-r--r--c_compiler/test/out/ComplexAssignment.s42
-rw-r--r--c_compiler/test/out/ComplexAssignment.stderr.txt0
-rwxr-xr-xc_compiler/test/out/ScopeWithAddbin0 -> 676204 bytes
-rw-r--r--c_compiler/test/out/ScopeWithAdd.s26
-rw-r--r--c_compiler/test/out/ScopeWithAdd.stderr.txt0
-rwxr-xr-xc_compiler/test/out/SimpleAddbin0 -> 676204 bytes
-rw-r--r--c_compiler/test/out/SimpleAdd.s19
-rw-r--r--c_compiler/test/out/SimpleAdd.stderr.txt0
-rwxr-xr-xc_compiler/test/out/SimpleAdd_2bin0 -> 676204 bytes
-rw-r--r--c_compiler/test/out/SimpleAdd_2.s19
-rw-r--r--c_compiler/test/out/SimpleAdd_2.stderr.txt0
-rwxr-xr-xc_compiler/test/out/SimpleAssignmentbin0 -> 676204 bytes
-rw-r--r--c_compiler/test/out/SimpleAssignment.s16
-rw-r--r--c_compiler/test/out/SimpleAssignment.stderr.txt0
-rwxr-xr-xc_compiler/test/out/SimpleDeclarationbin0 -> 672108 bytes
-rw-r--r--c_compiler/test/out/SimpleDeclaration.s14
-rw-r--r--c_compiler/test/out/SimpleDeclaration.stderr.txt0
-rwxr-xr-xc_compiler/test/out/SimpleReturnbin0 -> 672108 bytes
-rw-r--r--c_compiler/test/out/SimpleReturn.s12
-rw-r--r--c_compiler/test/out/SimpleReturn.stderr.txt0
-rwxr-xr-xc_compiler/test/out/SimpleScopebin0 -> 676204 bytes
-rw-r--r--c_compiler/test/out/SimpleScope.s16
-rw-r--r--c_compiler/test/out/SimpleScope.stderr.txt0
-rwxr-xr-xc_compiler/test/out/SimpleShadowingbin0 -> 676204 bytes
-rw-r--r--c_compiler/test/out/SimpleShadowing.s16
-rw-r--r--c_compiler/test/out/SimpleShadowing.stderr.txt0
-rwxr-xr-xc_compiler/test/out/SimpleSubtractionbin0 -> 676204 bytes
-rw-r--r--c_compiler/test/out/SimpleSubtraction.s21
-rw-r--r--c_compiler/test/out/SimpleSubtraction.stderr.txt0
-rwxr-xr-xc_compiler/test/ref/ComplexAssignmentbin0 -> 676272 bytes
-rw-r--r--c_compiler/test/ref/ComplexAssignment.s65
-rwxr-xr-xc_compiler/test/ref/ScopeWithAddbin0 -> 676264 bytes
-rw-r--r--c_compiler/test/ref/ScopeWithAdd.s43
-rwxr-xr-xc_compiler/test/ref/SimpleAddbin0 -> 676264 bytes
-rw-r--r--c_compiler/test/ref/SimpleAdd.s41
-rwxr-xr-xc_compiler/test/ref/SimpleAdd_2bin0 -> 676264 bytes
-rw-r--r--c_compiler/test/ref/SimpleAdd_2.s40
-rwxr-xr-xc_compiler/test/ref/SimpleAssignmentbin0 -> 672172 bytes
-rw-r--r--c_compiler/test/ref/SimpleAssignment.s37
-rwxr-xr-xc_compiler/test/ref/SimpleDeclarationbin0 -> 672176 bytes
-rw-r--r--c_compiler/test/ref/SimpleDeclaration.s37
-rwxr-xr-xc_compiler/test/ref/SimpleReturnbin0 -> 672168 bytes
-rw-r--r--c_compiler/test/ref/SimpleReturn.s35
-rwxr-xr-xc_compiler/test/ref/SimpleScopebin0 -> 676264 bytes
-rw-r--r--c_compiler/test/ref/SimpleScope.s39
-rwxr-xr-xc_compiler/test/ref/SimpleShadowingbin0 -> 676268 bytes
-rw-r--r--c_compiler/test/ref/SimpleShadowing.s39
-rwxr-xr-xc_compiler/test/ref/SimpleSubtractionbin0 -> 676272 bytes
-rw-r--r--c_compiler/test/ref/SimpleSubtraction.s43
51 files changed, 623 insertions, 5 deletions
diff --git a/c_compiler/test/in/SimpleAdd_2.c b/c_compiler/test/in/SimpleAdd_2.c
index c03a527..02b052b 100644
--- a/c_compiler/test/in/SimpleAdd_2.c
+++ b/c_compiler/test/in/SimpleAdd_2.c
@@ -1,9 +1,7 @@
int main() {
int x = 4;
- int y;
+
x = x + 1;
- x = x + 2;
-
- y = x - 1;
- y = x + y;
+
+ return x;
}
diff --git a/c_compiler/test/out/ComplexAssignment b/c_compiler/test/out/ComplexAssignment
new file mode 100755
index 0000000..f77cf43
--- /dev/null
+++ b/c_compiler/test/out/ComplexAssignment
Binary files differ
diff --git a/c_compiler/test/out/ComplexAssignment.s b/c_compiler/test/out/ComplexAssignment.s
new file mode 100644
index 0000000..210316c
--- /dev/null
+++ b/c_compiler/test/out/ComplexAssignment.s
@@ -0,0 +1,42 @@
+ .text
+ .globl main
+main:
+ addiu $sp,$sp,-32
+ sw $fp,28($sp)
+ move $fp,$sp
+ li $2,5
+ sw $2,4($fp)
+ li $2,49
+ sw $2,8($fp)
+ li $2,239
+ sw $2,12($fp)
+ li $2,23
+ sw $2,16($fp)
+ li $2,234
+ sw $2,20($fp)
+ li $2,12
+ sw $2,24($fp)
+ lw $2,16($fp)
+ sw $2,4($fp)
+ lw $2,20($fp)
+ sw $2,8($fp)
+ lw $2,20($fp)
+ sw $2,24($fp)
+ lw $2,24($fp)
+ sw $2,4($fp)
+ lw $2,24($fp)
+ sw $2,16($fp)
+ lw $2,16($fp)
+ sw $2,4($fp)
+ lw $2,12($fp)
+ sw $2,24($fp)
+ lw $2,4($fp)
+ sw $2,12($fp)
+ lw $2,20($fp)
+ sw $2,4($fp)
+ lw $2,4($fp)
+ move $sp,$fp
+ lw $fp,28($sp)
+ addiu $sp,$sp,32
+ jr $31
+ nop
diff --git a/c_compiler/test/out/ComplexAssignment.stderr.txt b/c_compiler/test/out/ComplexAssignment.stderr.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/c_compiler/test/out/ComplexAssignment.stderr.txt
diff --git a/c_compiler/test/out/ScopeWithAdd b/c_compiler/test/out/ScopeWithAdd
new file mode 100755
index 0000000..9002d11
--- /dev/null
+++ b/c_compiler/test/out/ScopeWithAdd
Binary files differ
diff --git a/c_compiler/test/out/ScopeWithAdd.s b/c_compiler/test/out/ScopeWithAdd.s
new file mode 100644
index 0000000..20e9a85
--- /dev/null
+++ b/c_compiler/test/out/ScopeWithAdd.s
@@ -0,0 +1,26 @@
+ .text
+ .globl main
+main:
+ addiu $sp,$sp,-20
+ sw $fp,16($sp)
+ move $fp,$sp
+ li $2,4
+ sw $2,4($fp)
+ li $2,35
+ sw $2,8($fp)
+ li $2,3
+ move $3,$2
+ li $2,3
+ add $2,$2,$3
+ sw $2,12($fp)
+ li $2,5
+ move $3,$2
+ li $2,4
+ add $2,$2,$3
+ sw $2,4($fp)
+ lw $2,4($fp)
+ move $sp,$fp
+ lw $fp,16($sp)
+ addiu $sp,$sp,20
+ jr $31
+ nop
diff --git a/c_compiler/test/out/ScopeWithAdd.stderr.txt b/c_compiler/test/out/ScopeWithAdd.stderr.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/c_compiler/test/out/ScopeWithAdd.stderr.txt
diff --git a/c_compiler/test/out/SimpleAdd b/c_compiler/test/out/SimpleAdd
new file mode 100755
index 0000000..bc41b4e
--- /dev/null
+++ b/c_compiler/test/out/SimpleAdd
Binary files differ
diff --git a/c_compiler/test/out/SimpleAdd.s b/c_compiler/test/out/SimpleAdd.s
new file mode 100644
index 0000000..939e610
--- /dev/null
+++ b/c_compiler/test/out/SimpleAdd.s
@@ -0,0 +1,19 @@
+ .text
+ .globl main
+main:
+ addiu $sp,$sp,-16
+ sw $fp,12($sp)
+ move $fp,$sp
+ li $2,68
+ sw $2,4($fp)
+ li $2,38
+ sw $2,8($fp)
+ lw $2,8($fp)
+ move $3,$2
+ lw $2,4($fp)
+ add $2,$2,$3
+ move $sp,$fp
+ lw $fp,12($sp)
+ addiu $sp,$sp,16
+ jr $31
+ nop
diff --git a/c_compiler/test/out/SimpleAdd.stderr.txt b/c_compiler/test/out/SimpleAdd.stderr.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/c_compiler/test/out/SimpleAdd.stderr.txt
diff --git a/c_compiler/test/out/SimpleAdd_2 b/c_compiler/test/out/SimpleAdd_2
new file mode 100755
index 0000000..976035b
--- /dev/null
+++ b/c_compiler/test/out/SimpleAdd_2
Binary files differ
diff --git a/c_compiler/test/out/SimpleAdd_2.s b/c_compiler/test/out/SimpleAdd_2.s
new file mode 100644
index 0000000..a40358b
--- /dev/null
+++ b/c_compiler/test/out/SimpleAdd_2.s
@@ -0,0 +1,19 @@
+ .text
+ .globl main
+main:
+ addiu $sp,$sp,-12
+ sw $fp,8($sp)
+ move $fp,$sp
+ li $2,4
+ sw $2,4($fp)
+ li $2,1
+ move $3,$2
+ lw $2,4($fp)
+ add $2,$2,$3
+ sw $2,4($fp)
+ lw $2,4($fp)
+ move $sp,$fp
+ lw $fp,8($sp)
+ addiu $sp,$sp,12
+ jr $31
+ nop
diff --git a/c_compiler/test/out/SimpleAdd_2.stderr.txt b/c_compiler/test/out/SimpleAdd_2.stderr.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/c_compiler/test/out/SimpleAdd_2.stderr.txt
diff --git a/c_compiler/test/out/SimpleAssignment b/c_compiler/test/out/SimpleAssignment
new file mode 100755
index 0000000..4c63ac1
--- /dev/null
+++ b/c_compiler/test/out/SimpleAssignment
Binary files differ
diff --git a/c_compiler/test/out/SimpleAssignment.s b/c_compiler/test/out/SimpleAssignment.s
new file mode 100644
index 0000000..900d816
--- /dev/null
+++ b/c_compiler/test/out/SimpleAssignment.s
@@ -0,0 +1,16 @@
+ .text
+ .globl main
+main:
+ addiu $sp,$sp,-12
+ sw $fp,8($sp)
+ move $fp,$sp
+ move $2,$0
+ sw $2,4($fp)
+ li $2,15
+ sw $2,4($fp)
+ lw $2,4($fp)
+ move $sp,$fp
+ lw $fp,8($sp)
+ addiu $sp,$sp,12
+ jr $31
+ nop
diff --git a/c_compiler/test/out/SimpleAssignment.stderr.txt b/c_compiler/test/out/SimpleAssignment.stderr.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/c_compiler/test/out/SimpleAssignment.stderr.txt
diff --git a/c_compiler/test/out/SimpleDeclaration b/c_compiler/test/out/SimpleDeclaration
new file mode 100755
index 0000000..2860c71
--- /dev/null
+++ b/c_compiler/test/out/SimpleDeclaration
Binary files differ
diff --git a/c_compiler/test/out/SimpleDeclaration.s b/c_compiler/test/out/SimpleDeclaration.s
new file mode 100644
index 0000000..c1ad16c
--- /dev/null
+++ b/c_compiler/test/out/SimpleDeclaration.s
@@ -0,0 +1,14 @@
+ .text
+ .globl main
+main:
+ addiu $sp,$sp,-12
+ sw $fp,8($sp)
+ move $fp,$sp
+ li $2,26
+ sw $2,4($fp)
+ lw $2,4($fp)
+ move $sp,$fp
+ lw $fp,8($sp)
+ addiu $sp,$sp,12
+ jr $31
+ nop
diff --git a/c_compiler/test/out/SimpleDeclaration.stderr.txt b/c_compiler/test/out/SimpleDeclaration.stderr.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/c_compiler/test/out/SimpleDeclaration.stderr.txt
diff --git a/c_compiler/test/out/SimpleReturn b/c_compiler/test/out/SimpleReturn
new file mode 100755
index 0000000..068ecc4
--- /dev/null
+++ b/c_compiler/test/out/SimpleReturn
Binary files differ
diff --git a/c_compiler/test/out/SimpleReturn.s b/c_compiler/test/out/SimpleReturn.s
new file mode 100644
index 0000000..2fdc6fa
--- /dev/null
+++ b/c_compiler/test/out/SimpleReturn.s
@@ -0,0 +1,12 @@
+ .text
+ .globl main
+main:
+ addiu $sp,$sp,-8
+ sw $fp,4($sp)
+ move $fp,$sp
+ li $2,13
+ move $sp,$fp
+ lw $fp,4($sp)
+ addiu $sp,$sp,8
+ jr $31
+ nop
diff --git a/c_compiler/test/out/SimpleReturn.stderr.txt b/c_compiler/test/out/SimpleReturn.stderr.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/c_compiler/test/out/SimpleReturn.stderr.txt
diff --git a/c_compiler/test/out/SimpleScope b/c_compiler/test/out/SimpleScope
new file mode 100755
index 0000000..00b247f
--- /dev/null
+++ b/c_compiler/test/out/SimpleScope
Binary files differ
diff --git a/c_compiler/test/out/SimpleScope.s b/c_compiler/test/out/SimpleScope.s
new file mode 100644
index 0000000..8d2fdc4
--- /dev/null
+++ b/c_compiler/test/out/SimpleScope.s
@@ -0,0 +1,16 @@
+ .text
+ .globl main
+main:
+ addiu $sp,$sp,-12
+ sw $fp,8($sp)
+ move $fp,$sp
+ li $2,23
+ sw $2,4($fp)
+ li $2,123
+ sw $2,4($fp)
+ lw $2,4($fp)
+ move $sp,$fp
+ lw $fp,8($sp)
+ addiu $sp,$sp,12
+ jr $31
+ nop
diff --git a/c_compiler/test/out/SimpleScope.stderr.txt b/c_compiler/test/out/SimpleScope.stderr.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/c_compiler/test/out/SimpleScope.stderr.txt
diff --git a/c_compiler/test/out/SimpleShadowing b/c_compiler/test/out/SimpleShadowing
new file mode 100755
index 0000000..12e2ae1
--- /dev/null
+++ b/c_compiler/test/out/SimpleShadowing
Binary files differ
diff --git a/c_compiler/test/out/SimpleShadowing.s b/c_compiler/test/out/SimpleShadowing.s
new file mode 100644
index 0000000..91f2bda
--- /dev/null
+++ b/c_compiler/test/out/SimpleShadowing.s
@@ -0,0 +1,16 @@
+ .text
+ .globl main
+main:
+ addiu $sp,$sp,-16
+ sw $fp,12($sp)
+ move $fp,$sp
+ li $2,12
+ sw $2,4($fp)
+ li $2,39
+ sw $2,8($fp)
+ lw $2,4($fp)
+ move $sp,$fp
+ lw $fp,12($sp)
+ addiu $sp,$sp,16
+ jr $31
+ nop
diff --git a/c_compiler/test/out/SimpleShadowing.stderr.txt b/c_compiler/test/out/SimpleShadowing.stderr.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/c_compiler/test/out/SimpleShadowing.stderr.txt
diff --git a/c_compiler/test/out/SimpleSubtraction b/c_compiler/test/out/SimpleSubtraction
new file mode 100755
index 0000000..4302fe4
--- /dev/null
+++ b/c_compiler/test/out/SimpleSubtraction
Binary files differ
diff --git a/c_compiler/test/out/SimpleSubtraction.s b/c_compiler/test/out/SimpleSubtraction.s
new file mode 100644
index 0000000..5c0e0a5
--- /dev/null
+++ b/c_compiler/test/out/SimpleSubtraction.s
@@ -0,0 +1,21 @@
+ .text
+ .globl main
+main:
+ addiu $sp,$sp,-20
+ sw $fp,16($sp)
+ move $fp,$sp
+ li $2,23
+ sw $2,4($fp)
+ li $2,19
+ sw $2,8($fp)
+ lw $2,8($fp)
+ move $3,$2
+ lw $2,4($fp)
+ sub $2,$2,$3
+ sw $2,12($fp)
+ lw $2,12($fp)
+ move $sp,$fp
+ lw $fp,16($sp)
+ addiu $sp,$sp,20
+ jr $31
+ nop
diff --git a/c_compiler/test/out/SimpleSubtraction.stderr.txt b/c_compiler/test/out/SimpleSubtraction.stderr.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/c_compiler/test/out/SimpleSubtraction.stderr.txt
diff --git a/c_compiler/test/ref/ComplexAssignment b/c_compiler/test/ref/ComplexAssignment
new file mode 100755
index 0000000..06111ed
--- /dev/null
+++ b/c_compiler/test/ref/ComplexAssignment
Binary files differ
diff --git a/c_compiler/test/ref/ComplexAssignment.s b/c_compiler/test/ref/ComplexAssignment.s
new file mode 100644
index 0000000..079bb29
--- /dev/null
+++ b/c_compiler/test/ref/ComplexAssignment.s
@@ -0,0 +1,65 @@
+ .file 1 "ComplexAssignment.c"
+ .section .mdebug.abi32
+ .previous
+ .nan legacy
+ .module fp=xx
+ .module nooddspreg
+ .abicalls
+ .text
+ .align 2
+ .globl main
+ .set nomips16
+ .set nomicromips
+ .ent main
+ .type main, @function
+main:
+ .frame $fp,32,$31 # vars= 24, regs= 1/0, args= 0, gp= 0
+ .mask 0x40000000,-4
+ .fmask 0x00000000,0
+ .set noreorder
+ .set nomacro
+ addiu $sp,$sp,-32
+ sw $fp,28($sp)
+ move $fp,$sp
+ li $2,5 # 0x5
+ sw $2,0($fp)
+ li $2,49 # 0x31
+ sw $2,4($fp)
+ li $2,239 # 0xef
+ sw $2,8($fp)
+ li $2,23 # 0x17
+ sw $2,12($fp)
+ li $2,234 # 0xea
+ sw $2,16($fp)
+ li $2,12 # 0xc
+ sw $2,20($fp)
+ lw $2,12($fp)
+ sw $2,0($fp)
+ lw $2,16($fp)
+ sw $2,4($fp)
+ lw $2,16($fp)
+ sw $2,20($fp)
+ lw $2,20($fp)
+ sw $2,0($fp)
+ lw $2,20($fp)
+ sw $2,12($fp)
+ lw $2,12($fp)
+ sw $2,0($fp)
+ lw $2,8($fp)
+ sw $2,20($fp)
+ lw $2,0($fp)
+ sw $2,8($fp)
+ lw $2,16($fp)
+ sw $2,0($fp)
+ lw $2,0($fp)
+ move $sp,$fp
+ lw $fp,28($sp)
+ addiu $sp,$sp,32
+ j $31
+ nop
+
+ .set macro
+ .set reorder
+ .end main
+ .size main, .-main
+ .ident "GCC: (Ubuntu 5.4.0-6ubuntu1~16.04.1) 5.4.0 20160609"
diff --git a/c_compiler/test/ref/ScopeWithAdd b/c_compiler/test/ref/ScopeWithAdd
new file mode 100755
index 0000000..51f517d
--- /dev/null
+++ b/c_compiler/test/ref/ScopeWithAdd
Binary files differ
diff --git a/c_compiler/test/ref/ScopeWithAdd.s b/c_compiler/test/ref/ScopeWithAdd.s
new file mode 100644
index 0000000..74b98b0
--- /dev/null
+++ b/c_compiler/test/ref/ScopeWithAdd.s
@@ -0,0 +1,43 @@
+ .file 1 "ScopeWithAdd.c"
+ .section .mdebug.abi32
+ .previous
+ .nan legacy
+ .module fp=xx
+ .module nooddspreg
+ .abicalls
+ .text
+ .align 2
+ .globl main
+ .set nomips16
+ .set nomicromips
+ .ent main
+ .type main, @function
+main:
+ .frame $fp,24,$31 # vars= 16, regs= 1/0, args= 0, gp= 0
+ .mask 0x40000000,-4
+ .fmask 0x00000000,0
+ .set noreorder
+ .set nomacro
+ addiu $sp,$sp,-24
+ sw $fp,20($sp)
+ move $fp,$sp
+ li $2,4 # 0x4
+ sw $2,4($fp)
+ li $2,35 # 0x23
+ sw $2,8($fp)
+ li $2,6 # 0x6
+ sw $2,12($fp)
+ li $2,9 # 0x9
+ sw $2,4($fp)
+ lw $2,4($fp)
+ move $sp,$fp
+ lw $fp,20($sp)
+ addiu $sp,$sp,24
+ j $31
+ nop
+
+ .set macro
+ .set reorder
+ .end main
+ .size main, .-main
+ .ident "GCC: (Ubuntu 5.4.0-6ubuntu1~16.04.1) 5.4.0 20160609"
diff --git a/c_compiler/test/ref/SimpleAdd b/c_compiler/test/ref/SimpleAdd
new file mode 100755
index 0000000..726818a
--- /dev/null
+++ b/c_compiler/test/ref/SimpleAdd
Binary files differ
diff --git a/c_compiler/test/ref/SimpleAdd.s b/c_compiler/test/ref/SimpleAdd.s
new file mode 100644
index 0000000..ae0189f
--- /dev/null
+++ b/c_compiler/test/ref/SimpleAdd.s
@@ -0,0 +1,41 @@
+ .file 1 "SimpleAdd.c"
+ .section .mdebug.abi32
+ .previous
+ .nan legacy
+ .module fp=xx
+ .module nooddspreg
+ .abicalls
+ .text
+ .align 2
+ .globl main
+ .set nomips16
+ .set nomicromips
+ .ent main
+ .type main, @function
+main:
+ .frame $fp,16,$31 # vars= 8, regs= 1/0, args= 0, gp= 0
+ .mask 0x40000000,-4
+ .fmask 0x00000000,0
+ .set noreorder
+ .set nomacro
+ addiu $sp,$sp,-16
+ sw $fp,12($sp)
+ move $fp,$sp
+ li $2,68 # 0x44
+ sw $2,0($fp)
+ li $2,38 # 0x26
+ sw $2,4($fp)
+ lw $3,0($fp)
+ lw $2,4($fp)
+ addu $2,$3,$2
+ move $sp,$fp
+ lw $fp,12($sp)
+ addiu $sp,$sp,16
+ j $31
+ nop
+
+ .set macro
+ .set reorder
+ .end main
+ .size main, .-main
+ .ident "GCC: (Ubuntu 5.4.0-6ubuntu1~16.04.1) 5.4.0 20160609"
diff --git a/c_compiler/test/ref/SimpleAdd_2 b/c_compiler/test/ref/SimpleAdd_2
new file mode 100755
index 0000000..d87e5ec
--- /dev/null
+++ b/c_compiler/test/ref/SimpleAdd_2
Binary files differ
diff --git a/c_compiler/test/ref/SimpleAdd_2.s b/c_compiler/test/ref/SimpleAdd_2.s
new file mode 100644
index 0000000..516f1a2
--- /dev/null
+++ b/c_compiler/test/ref/SimpleAdd_2.s
@@ -0,0 +1,40 @@
+ .file 1 "SimpleAdd_2.c"
+ .section .mdebug.abi32
+ .previous
+ .nan legacy
+ .module fp=xx
+ .module nooddspreg
+ .abicalls
+ .text
+ .align 2
+ .globl main
+ .set nomips16
+ .set nomicromips
+ .ent main
+ .type main, @function
+main:
+ .frame $fp,16,$31 # vars= 8, regs= 1/0, args= 0, gp= 0
+ .mask 0x40000000,-4
+ .fmask 0x00000000,0
+ .set noreorder
+ .set nomacro
+ addiu $sp,$sp,-16
+ sw $fp,12($sp)
+ move $fp,$sp
+ li $2,4 # 0x4
+ sw $2,4($fp)
+ lw $2,4($fp)
+ addiu $2,$2,1
+ sw $2,4($fp)
+ lw $2,4($fp)
+ move $sp,$fp
+ lw $fp,12($sp)
+ addiu $sp,$sp,16
+ j $31
+ nop
+
+ .set macro
+ .set reorder
+ .end main
+ .size main, .-main
+ .ident "GCC: (Ubuntu 5.4.0-6ubuntu1~16.04.1) 5.4.0 20160609"
diff --git a/c_compiler/test/ref/SimpleAssignment b/c_compiler/test/ref/SimpleAssignment
new file mode 100755
index 0000000..8b5a267
--- /dev/null
+++ b/c_compiler/test/ref/SimpleAssignment
Binary files differ
diff --git a/c_compiler/test/ref/SimpleAssignment.s b/c_compiler/test/ref/SimpleAssignment.s
new file mode 100644
index 0000000..87ba9db
--- /dev/null
+++ b/c_compiler/test/ref/SimpleAssignment.s
@@ -0,0 +1,37 @@
+ .file 1 "SimpleAssignment.c"
+ .section .mdebug.abi32
+ .previous
+ .nan legacy
+ .module fp=xx
+ .module nooddspreg
+ .abicalls
+ .text
+ .align 2
+ .globl main
+ .set nomips16
+ .set nomicromips
+ .ent main
+ .type main, @function
+main:
+ .frame $fp,16,$31 # vars= 8, regs= 1/0, args= 0, gp= 0
+ .mask 0x40000000,-4
+ .fmask 0x00000000,0
+ .set noreorder
+ .set nomacro
+ addiu $sp,$sp,-16
+ sw $fp,12($sp)
+ move $fp,$sp
+ li $2,15 # 0xf
+ sw $2,4($fp)
+ lw $2,4($fp)
+ move $sp,$fp
+ lw $fp,12($sp)
+ addiu $sp,$sp,16
+ j $31
+ nop
+
+ .set macro
+ .set reorder
+ .end main
+ .size main, .-main
+ .ident "GCC: (Ubuntu 5.4.0-6ubuntu1~16.04.1) 5.4.0 20160609"
diff --git a/c_compiler/test/ref/SimpleDeclaration b/c_compiler/test/ref/SimpleDeclaration
new file mode 100755
index 0000000..c631eea
--- /dev/null
+++ b/c_compiler/test/ref/SimpleDeclaration
Binary files differ
diff --git a/c_compiler/test/ref/SimpleDeclaration.s b/c_compiler/test/ref/SimpleDeclaration.s
new file mode 100644
index 0000000..943dca7
--- /dev/null
+++ b/c_compiler/test/ref/SimpleDeclaration.s
@@ -0,0 +1,37 @@
+ .file 1 "SimpleDeclaration.c"
+ .section .mdebug.abi32
+ .previous
+ .nan legacy
+ .module fp=xx
+ .module nooddspreg
+ .abicalls
+ .text
+ .align 2
+ .globl main
+ .set nomips16
+ .set nomicromips
+ .ent main
+ .type main, @function
+main:
+ .frame $fp,16,$31 # vars= 8, regs= 1/0, args= 0, gp= 0
+ .mask 0x40000000,-4
+ .fmask 0x00000000,0
+ .set noreorder
+ .set nomacro
+ addiu $sp,$sp,-16
+ sw $fp,12($sp)
+ move $fp,$sp
+ li $2,26 # 0x1a
+ sw $2,4($fp)
+ lw $2,4($fp)
+ move $sp,$fp
+ lw $fp,12($sp)
+ addiu $sp,$sp,16
+ j $31
+ nop
+
+ .set macro
+ .set reorder
+ .end main
+ .size main, .-main
+ .ident "GCC: (Ubuntu 5.4.0-6ubuntu1~16.04.1) 5.4.0 20160609"
diff --git a/c_compiler/test/ref/SimpleReturn b/c_compiler/test/ref/SimpleReturn
new file mode 100755
index 0000000..f7448a9
--- /dev/null
+++ b/c_compiler/test/ref/SimpleReturn
Binary files differ
diff --git a/c_compiler/test/ref/SimpleReturn.s b/c_compiler/test/ref/SimpleReturn.s
new file mode 100644
index 0000000..ce724b2
--- /dev/null
+++ b/c_compiler/test/ref/SimpleReturn.s
@@ -0,0 +1,35 @@
+ .file 1 "SimpleReturn.c"
+ .section .mdebug.abi32
+ .previous
+ .nan legacy
+ .module fp=xx
+ .module nooddspreg
+ .abicalls
+ .text
+ .align 2
+ .globl main
+ .set nomips16
+ .set nomicromips
+ .ent main
+ .type main, @function
+main:
+ .frame $fp,8,$31 # vars= 0, regs= 1/0, args= 0, gp= 0
+ .mask 0x40000000,-4
+ .fmask 0x00000000,0
+ .set noreorder
+ .set nomacro
+ addiu $sp,$sp,-8
+ sw $fp,4($sp)
+ move $fp,$sp
+ li $2,13 # 0xd
+ move $sp,$fp
+ lw $fp,4($sp)
+ addiu $sp,$sp,8
+ j $31
+ nop
+
+ .set macro
+ .set reorder
+ .end main
+ .size main, .-main
+ .ident "GCC: (Ubuntu 5.4.0-6ubuntu1~16.04.1) 5.4.0 20160609"
diff --git a/c_compiler/test/ref/SimpleScope b/c_compiler/test/ref/SimpleScope
new file mode 100755
index 0000000..bb7927b
--- /dev/null
+++ b/c_compiler/test/ref/SimpleScope
Binary files differ
diff --git a/c_compiler/test/ref/SimpleScope.s b/c_compiler/test/ref/SimpleScope.s
new file mode 100644
index 0000000..ba0c6f9
--- /dev/null
+++ b/c_compiler/test/ref/SimpleScope.s
@@ -0,0 +1,39 @@
+ .file 1 "SimpleScope.c"
+ .section .mdebug.abi32
+ .previous
+ .nan legacy
+ .module fp=xx
+ .module nooddspreg
+ .abicalls
+ .text
+ .align 2
+ .globl main
+ .set nomips16
+ .set nomicromips
+ .ent main
+ .type main, @function
+main:
+ .frame $fp,16,$31 # vars= 8, regs= 1/0, args= 0, gp= 0
+ .mask 0x40000000,-4
+ .fmask 0x00000000,0
+ .set noreorder
+ .set nomacro
+ addiu $sp,$sp,-16
+ sw $fp,12($sp)
+ move $fp,$sp
+ li $2,23 # 0x17
+ sw $2,4($fp)
+ li $2,123 # 0x7b
+ sw $2,4($fp)
+ lw $2,4($fp)
+ move $sp,$fp
+ lw $fp,12($sp)
+ addiu $sp,$sp,16
+ j $31
+ nop
+
+ .set macro
+ .set reorder
+ .end main
+ .size main, .-main
+ .ident "GCC: (Ubuntu 5.4.0-6ubuntu1~16.04.1) 5.4.0 20160609"
diff --git a/c_compiler/test/ref/SimpleShadowing b/c_compiler/test/ref/SimpleShadowing
new file mode 100755
index 0000000..c285cff
--- /dev/null
+++ b/c_compiler/test/ref/SimpleShadowing
Binary files differ
diff --git a/c_compiler/test/ref/SimpleShadowing.s b/c_compiler/test/ref/SimpleShadowing.s
new file mode 100644
index 0000000..2b47586
--- /dev/null
+++ b/c_compiler/test/ref/SimpleShadowing.s
@@ -0,0 +1,39 @@
+ .file 1 "SimpleShadowing.c"
+ .section .mdebug.abi32
+ .previous
+ .nan legacy
+ .module fp=xx
+ .module nooddspreg
+ .abicalls
+ .text
+ .align 2
+ .globl main
+ .set nomips16
+ .set nomicromips
+ .ent main
+ .type main, @function
+main:
+ .frame $fp,16,$31 # vars= 8, regs= 1/0, args= 0, gp= 0
+ .mask 0x40000000,-4
+ .fmask 0x00000000,0
+ .set noreorder
+ .set nomacro
+ addiu $sp,$sp,-16
+ sw $fp,12($sp)
+ move $fp,$sp
+ li $2,12 # 0xc
+ sw $2,0($fp)
+ li $2,39 # 0x27
+ sw $2,4($fp)
+ lw $2,0($fp)
+ move $sp,$fp
+ lw $fp,12($sp)
+ addiu $sp,$sp,16
+ j $31
+ nop
+
+ .set macro
+ .set reorder
+ .end main
+ .size main, .-main
+ .ident "GCC: (Ubuntu 5.4.0-6ubuntu1~16.04.1) 5.4.0 20160609"
diff --git a/c_compiler/test/ref/SimpleSubtraction b/c_compiler/test/ref/SimpleSubtraction
new file mode 100755
index 0000000..6436dcd
--- /dev/null
+++ b/c_compiler/test/ref/SimpleSubtraction
Binary files differ
diff --git a/c_compiler/test/ref/SimpleSubtraction.s b/c_compiler/test/ref/SimpleSubtraction.s
new file mode 100644
index 0000000..ca1493f
--- /dev/null
+++ b/c_compiler/test/ref/SimpleSubtraction.s
@@ -0,0 +1,43 @@
+ .file 1 "SimpleSubtraction.c"
+ .section .mdebug.abi32
+ .previous
+ .nan legacy
+ .module fp=xx
+ .module nooddspreg
+ .abicalls
+ .text
+ .align 2
+ .globl main
+ .set nomips16
+ .set nomicromips
+ .ent main
+ .type main, @function
+main:
+ .frame $fp,24,$31 # vars= 16, regs= 1/0, args= 0, gp= 0
+ .mask 0x40000000,-4
+ .fmask 0x00000000,0
+ .set noreorder
+ .set nomacro
+ addiu $sp,$sp,-24
+ sw $fp,20($sp)
+ move $fp,$sp
+ li $2,23 # 0x17
+ sw $2,4($fp)
+ li $2,19 # 0x13
+ sw $2,8($fp)
+ lw $3,4($fp)
+ lw $2,8($fp)
+ subu $2,$3,$2
+ sw $2,12($fp)
+ lw $2,12($fp)
+ move $sp,$fp
+ lw $fp,20($sp)
+ addiu $sp,$sp,24
+ j $31
+ nop
+
+ .set macro
+ .set reorder
+ .end main
+ .size main, .-main
+ .ident "GCC: (Ubuntu 5.4.0-6ubuntu1~16.04.1) 5.4.0 20160609"