From 7606b62bc81fd8ea55a6a65104be273f954e70c1 Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Fri, 10 Mar 2017 21:23:53 +0000 Subject: Changed simple test case --- c_compiler/test/ref/ComplexAssignment | Bin 0 -> 676272 bytes c_compiler/test/ref/ComplexAssignment.s | 65 ++++++++++++++++++++++++++++++++ c_compiler/test/ref/ScopeWithAdd | Bin 0 -> 676264 bytes c_compiler/test/ref/ScopeWithAdd.s | 43 +++++++++++++++++++++ c_compiler/test/ref/SimpleAdd | Bin 0 -> 676264 bytes c_compiler/test/ref/SimpleAdd.s | 41 ++++++++++++++++++++ c_compiler/test/ref/SimpleAdd_2 | Bin 0 -> 676264 bytes c_compiler/test/ref/SimpleAdd_2.s | 40 ++++++++++++++++++++ c_compiler/test/ref/SimpleAssignment | Bin 0 -> 672172 bytes c_compiler/test/ref/SimpleAssignment.s | 37 ++++++++++++++++++ c_compiler/test/ref/SimpleDeclaration | Bin 0 -> 672176 bytes c_compiler/test/ref/SimpleDeclaration.s | 37 ++++++++++++++++++ c_compiler/test/ref/SimpleReturn | Bin 0 -> 672168 bytes c_compiler/test/ref/SimpleReturn.s | 35 +++++++++++++++++ c_compiler/test/ref/SimpleScope | Bin 0 -> 676264 bytes c_compiler/test/ref/SimpleScope.s | 39 +++++++++++++++++++ c_compiler/test/ref/SimpleShadowing | Bin 0 -> 676268 bytes c_compiler/test/ref/SimpleShadowing.s | 39 +++++++++++++++++++ c_compiler/test/ref/SimpleSubtraction | Bin 0 -> 676272 bytes c_compiler/test/ref/SimpleSubtraction.s | 43 +++++++++++++++++++++ 20 files changed, 419 insertions(+) create mode 100755 c_compiler/test/ref/ComplexAssignment create mode 100644 c_compiler/test/ref/ComplexAssignment.s create mode 100755 c_compiler/test/ref/ScopeWithAdd create mode 100644 c_compiler/test/ref/ScopeWithAdd.s create mode 100755 c_compiler/test/ref/SimpleAdd create mode 100644 c_compiler/test/ref/SimpleAdd.s create mode 100755 c_compiler/test/ref/SimpleAdd_2 create mode 100644 c_compiler/test/ref/SimpleAdd_2.s create mode 100755 c_compiler/test/ref/SimpleAssignment create mode 100644 c_compiler/test/ref/SimpleAssignment.s create mode 100755 c_compiler/test/ref/SimpleDeclaration create mode 100644 c_compiler/test/ref/SimpleDeclaration.s create mode 100755 c_compiler/test/ref/SimpleReturn create mode 100644 c_compiler/test/ref/SimpleReturn.s create mode 100755 c_compiler/test/ref/SimpleScope create mode 100644 c_compiler/test/ref/SimpleScope.s create mode 100755 c_compiler/test/ref/SimpleShadowing create mode 100644 c_compiler/test/ref/SimpleShadowing.s create mode 100755 c_compiler/test/ref/SimpleSubtraction create mode 100644 c_compiler/test/ref/SimpleSubtraction.s (limited to 'c_compiler/test/ref') diff --git a/c_compiler/test/ref/ComplexAssignment b/c_compiler/test/ref/ComplexAssignment new file mode 100755 index 0000000..06111ed Binary files /dev/null and b/c_compiler/test/ref/ComplexAssignment 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 Binary files /dev/null and b/c_compiler/test/ref/ScopeWithAdd 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 Binary files /dev/null and b/c_compiler/test/ref/SimpleAdd 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 Binary files /dev/null and b/c_compiler/test/ref/SimpleAdd_2 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 Binary files /dev/null and b/c_compiler/test/ref/SimpleAssignment 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 Binary files /dev/null and b/c_compiler/test/ref/SimpleDeclaration 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 Binary files /dev/null and b/c_compiler/test/ref/SimpleReturn 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 Binary files /dev/null and b/c_compiler/test/ref/SimpleScope 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 Binary files /dev/null and b/c_compiler/test/ref/SimpleShadowing 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 Binary files /dev/null and b/c_compiler/test/ref/SimpleSubtraction 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" -- cgit