diff options
Diffstat (limited to 'c_compiler/test')
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 Binary files differnew file mode 100755 index 0000000..f77cf43 --- /dev/null +++ b/c_compiler/test/out/ComplexAssignment 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 Binary files differnew file mode 100755 index 0000000..9002d11 --- /dev/null +++ b/c_compiler/test/out/ScopeWithAdd 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 Binary files differnew file mode 100755 index 0000000..bc41b4e --- /dev/null +++ b/c_compiler/test/out/SimpleAdd 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 Binary files differnew file mode 100755 index 0000000..976035b --- /dev/null +++ b/c_compiler/test/out/SimpleAdd_2 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 Binary files differnew file mode 100755 index 0000000..4c63ac1 --- /dev/null +++ b/c_compiler/test/out/SimpleAssignment 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 Binary files differnew file mode 100755 index 0000000..2860c71 --- /dev/null +++ b/c_compiler/test/out/SimpleDeclaration 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 Binary files differnew file mode 100755 index 0000000..068ecc4 --- /dev/null +++ b/c_compiler/test/out/SimpleReturn 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 Binary files differnew file mode 100755 index 0000000..00b247f --- /dev/null +++ b/c_compiler/test/out/SimpleScope 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 Binary files differnew file mode 100755 index 0000000..12e2ae1 --- /dev/null +++ b/c_compiler/test/out/SimpleShadowing 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 Binary files differnew file mode 100755 index 0000000..4302fe4 --- /dev/null +++ b/c_compiler/test/out/SimpleSubtraction 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 Binary files differnew file mode 100755 index 0000000..06111ed --- /dev/null +++ b/c_compiler/test/ref/ComplexAssignment 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 Binary files differnew file mode 100755 index 0000000..51f517d --- /dev/null +++ b/c_compiler/test/ref/ScopeWithAdd 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 Binary files differnew file mode 100755 index 0000000..726818a --- /dev/null +++ b/c_compiler/test/ref/SimpleAdd 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 Binary files differnew file mode 100755 index 0000000..d87e5ec --- /dev/null +++ b/c_compiler/test/ref/SimpleAdd_2 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 Binary files differnew file mode 100755 index 0000000..8b5a267 --- /dev/null +++ b/c_compiler/test/ref/SimpleAssignment 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 Binary files differnew file mode 100755 index 0000000..c631eea --- /dev/null +++ b/c_compiler/test/ref/SimpleDeclaration 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 Binary files differnew file mode 100755 index 0000000..f7448a9 --- /dev/null +++ b/c_compiler/test/ref/SimpleReturn 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 Binary files differnew file mode 100755 index 0000000..bb7927b --- /dev/null +++ b/c_compiler/test/ref/SimpleScope 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 Binary files differnew file mode 100755 index 0000000..c285cff --- /dev/null +++ b/c_compiler/test/ref/SimpleShadowing 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 Binary files differnew file mode 100755 index 0000000..6436dcd --- /dev/null +++ b/c_compiler/test/ref/SimpleSubtraction 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" |