aboutsummaryrefslogtreecommitdiffstats
path: root/c_compiler/test
diff options
context:
space:
mode:
Diffstat (limited to 'c_compiler/test')
-rw-r--r--c_compiler/test/in/01.c6
-rw-r--r--c_compiler/test/in/02.c1
-rw-r--r--c_compiler/test/in/03.c1
-rw-r--r--c_compiler/test/in/04.c4
-rw-r--r--c_compiler/test/in/05.c3
-rw-r--r--c_compiler/test/in/06.c6
-rw-r--r--c_compiler/test/in/07.c5
-rw-r--r--c_compiler/test/in/08.c10
-rw-r--r--c_compiler/test/in/09.c15
-rw-r--r--c_compiler/test/in/10.c18
-rw-r--r--c_compiler/test/in/11.c10
-rw-r--r--c_compiler/test/in/12.c4
-rw-r--r--c_compiler/test/in/13.c8
-rw-r--r--c_compiler/test/in/14.c12
-rw-r--r--c_compiler/test/in/15.c28
-rw-r--r--c_compiler/test/out/01.diff.txt0
-rw-r--r--c_compiler/test/out/01.pretty.xml9
-rw-r--r--c_compiler/test/out/01.stderr.txt0
-rw-r--r--c_compiler/test/out/01.stdout.txt9
-rw-r--r--c_compiler/test/out/01.stdout.xml9
-rw-r--r--c_compiler/test/out/02.diff.txt0
-rw-r--r--c_compiler/test/out/02.pretty.xml6
-rw-r--r--c_compiler/test/out/02.stderr.txt0
-rw-r--r--c_compiler/test/out/02.stdout.xml7
-rw-r--r--c_compiler/test/out/03.diff.txt0
-rw-r--r--c_compiler/test/out/03.pretty.xml7
-rw-r--r--c_compiler/test/out/03.stderr.txt0
-rw-r--r--c_compiler/test/out/03.stdout.xml8
-rw-r--r--c_compiler/test/out/04.diff.txt0
-rw-r--r--c_compiler/test/out/04.pretty.xml12
-rw-r--r--c_compiler/test/out/04.stderr.txt0
-rw-r--r--c_compiler/test/out/04.stdout.xml12
-rw-r--r--c_compiler/test/out/05.diff.txt0
-rw-r--r--c_compiler/test/out/05.pretty.xml10
-rw-r--r--c_compiler/test/out/05.stderr.txt0
-rw-r--r--c_compiler/test/out/05.stdout.xml11
-rw-r--r--c_compiler/test/out/06.diff.txt0
-rw-r--r--c_compiler/test/out/06.pretty.xml14
-rw-r--r--c_compiler/test/out/06.stderr.txt0
-rw-r--r--c_compiler/test/out/06.stdout.xml14
-rw-r--r--c_compiler/test/out/07.diff.txt0
-rw-r--r--c_compiler/test/out/07.pretty.xml11
-rw-r--r--c_compiler/test/out/07.stderr.txt0
-rw-r--r--c_compiler/test/out/07.stdout.xml11
-rw-r--r--c_compiler/test/out/08.diff.txt0
-rw-r--r--c_compiler/test/out/08.pretty.xml16
-rw-r--r--c_compiler/test/out/08.stderr.txt0
-rw-r--r--c_compiler/test/out/08.stdout.xml16
-rw-r--r--c_compiler/test/out/09.diff.txt0
-rw-r--r--c_compiler/test/out/09.pretty.xml20
-rw-r--r--c_compiler/test/out/09.stderr.txt0
-rw-r--r--c_compiler/test/out/09.stdout.xml21
-rw-r--r--c_compiler/test/out/10.diff.txt0
-rw-r--r--c_compiler/test/out/10.pretty.xml19
-rw-r--r--c_compiler/test/out/10.stderr.txt0
-rw-r--r--c_compiler/test/out/10.stdout.xml20
-rw-r--r--c_compiler/test/out/11.diff.txt0
-rw-r--r--c_compiler/test/out/11.pretty.xml11
-rw-r--r--c_compiler/test/out/11.stderr.txt0
-rw-r--r--c_compiler/test/out/11.stdout.xml11
-rw-r--r--c_compiler/test/out/12.diff.txt0
-rw-r--r--c_compiler/test/out/12.pretty.xml10
-rw-r--r--c_compiler/test/out/12.stderr.txt0
-rw-r--r--c_compiler/test/out/12.stdout.xml10
-rw-r--r--c_compiler/test/out/13.diff.txt0
-rw-r--r--c_compiler/test/out/13.pretty.xml13
-rw-r--r--c_compiler/test/out/13.stderr.txt0
-rw-r--r--c_compiler/test/out/13.stdout.xml13
-rw-r--r--c_compiler/test/out/14.diff.txt0
-rw-r--r--c_compiler/test/out/14.pretty.xml13
-rw-r--r--c_compiler/test/out/14.stderr.txt0
-rw-r--r--c_compiler/test/out/14.stdout.xml13
-rw-r--r--c_compiler/test/out/15.diff.txt0
-rw-r--r--c_compiler/test/out/15.pretty.xml32
-rw-r--r--c_compiler/test/out/15.stderr.txt0
-rw-r--r--c_compiler/test/out/15.stdout.xml32
-rw-r--r--c_compiler/test/ref/01.stdout.xml9
-rw-r--r--c_compiler/test/ref/02.stdout.xml7
-rw-r--r--c_compiler/test/ref/03.stdout.xml8
-rw-r--r--c_compiler/test/ref/04.stdout.xml12
-rw-r--r--c_compiler/test/ref/05.stdout.xml11
-rw-r--r--c_compiler/test/ref/06.stdout.xml14
-rw-r--r--c_compiler/test/ref/07.stdout.xml11
-rw-r--r--c_compiler/test/ref/08.stdout.xml16
-rw-r--r--c_compiler/test/ref/09.stdout.xml21
-rw-r--r--c_compiler/test/ref/10.stdout.xml20
-rw-r--r--c_compiler/test/ref/11.stdout.xml11
-rw-r--r--c_compiler/test/ref/12.stdout.xml10
-rw-r--r--c_compiler/test/ref/13.stdout.xml13
-rw-r--r--c_compiler/test/ref/14.stdout.xml13
-rw-r--r--c_compiler/test/ref/15.stdout.xml32
91 files changed, 759 insertions, 0 deletions
diff --git a/c_compiler/test/in/01.c b/c_compiler/test/in/01.c
new file mode 100644
index 0000000..76425b5
--- /dev/null
+++ b/c_compiler/test/in/01.c
@@ -0,0 +1,6 @@
+int a;
+int b = 0;
+int c, d;
+
+int e,
+ f;
diff --git a/c_compiler/test/in/02.c b/c_compiler/test/in/02.c
new file mode 100644
index 0000000..45b1467
--- /dev/null
+++ b/c_compiler/test/in/02.c
@@ -0,0 +1 @@
+int f() {}
diff --git a/c_compiler/test/in/03.c b/c_compiler/test/in/03.c
new file mode 100644
index 0000000..e57aaa9
--- /dev/null
+++ b/c_compiler/test/in/03.c
@@ -0,0 +1 @@
+int foo(int bar) {}
diff --git a/c_compiler/test/in/04.c b/c_compiler/test/in/04.c
new file mode 100644
index 0000000..2e3aa5d
--- /dev/null
+++ b/c_compiler/test/in/04.c
@@ -0,0 +1,4 @@
+int foo(int bar1, int bar2) {
+ int x;
+ int y, z;
+}
diff --git a/c_compiler/test/in/05.c b/c_compiler/test/in/05.c
new file mode 100644
index 0000000..2317163
--- /dev/null
+++ b/c_compiler/test/in/05.c
@@ -0,0 +1,3 @@
+int foo(int x, int y) {
+ {}
+}
diff --git a/c_compiler/test/in/06.c b/c_compiler/test/in/06.c
new file mode 100644
index 0000000..2dcdc2b
--- /dev/null
+++ b/c_compiler/test/in/06.c
@@ -0,0 +1,6 @@
+int f(int a, int b, int c) {
+ int d;
+ {
+ int e;
+ }
+}
diff --git a/c_compiler/test/in/07.c b/c_compiler/test/in/07.c
new file mode 100644
index 0000000..80d8051
--- /dev/null
+++ b/c_compiler/test/in/07.c
@@ -0,0 +1,5 @@
+int foo(int a) {
+ if(x == y) {
+ int z;
+ }
+}
diff --git a/c_compiler/test/in/08.c b/c_compiler/test/in/08.c
new file mode 100644
index 0000000..c57a6ab
--- /dev/null
+++ b/c_compiler/test/in/08.c
@@ -0,0 +1,10 @@
+int func(int a, int b) {
+ int c = 0;
+ if(a == b) {
+ int d;
+ } else if(a == d) {
+ int e;
+ return d;
+ }
+ return c;
+}
diff --git a/c_compiler/test/in/09.c b/c_compiler/test/in/09.c
new file mode 100644
index 0000000..ae86bb1
--- /dev/null
+++ b/c_compiler/test/in/09.c
@@ -0,0 +1,15 @@
+int x()
+{}
+
+int g;
+
+int zz(int a, int b, int c)
+{
+ if(a==b){
+ int a;
+ return a;
+ }else{
+ int fsdfsdfs;
+ return c;
+ }
+}
diff --git a/c_compiler/test/in/10.c b/c_compiler/test/in/10.c
new file mode 100644
index 0000000..37a6ecc
--- /dev/null
+++ b/c_compiler/test/in/10.c
@@ -0,0 +1,18 @@
+int f()
+{}
+
+int g = 2;
+
+int x(int y) {
+ int z = 3;
+
+ if(y < z || g < z) {
+ int r;
+ ++y;
+ } else if(y == z) {
+ int f;
+ --y;
+ } else return y;
+
+ return g;
+}
diff --git a/c_compiler/test/in/11.c b/c_compiler/test/in/11.c
new file mode 100644
index 0000000..2d8cac6
--- /dev/null
+++ b/c_compiler/test/in/11.c
@@ -0,0 +1,10 @@
+int f() {
+ int x = 0;
+
+ while(x < 5) {
+ int y = 0;
+ x++;
+ }
+
+ return x;
+}
diff --git a/c_compiler/test/in/12.c b/c_compiler/test/in/12.c
new file mode 100644
index 0000000..37b8b7e
--- /dev/null
+++ b/c_compiler/test/in/12.c
@@ -0,0 +1,4 @@
+int f(int b, int c) {
+ int a = b+c;
+ return a;
+}
diff --git a/c_compiler/test/in/13.c b/c_compiler/test/in/13.c
new file mode 100644
index 0000000..d912d70
--- /dev/null
+++ b/c_compiler/test/in/13.c
@@ -0,0 +1,8 @@
+int func(int x, int y) {
+ int i;
+ for(i = 0; i < 5; ++i) {
+ int z = 0;
+ z = x + y + i;
+ return x + y;
+ }
+}
diff --git a/c_compiler/test/in/14.c b/c_compiler/test/in/14.c
new file mode 100644
index 0000000..94506d7
--- /dev/null
+++ b/c_compiler/test/in/14.c
@@ -0,0 +1,12 @@
+int function_1(int a, int b) {
+ int x = 0;
+
+ do {
+ int c = a + b;
+ x += a;
+ x = x * b;
+ x -= c;
+ } while(x < 500);
+
+ return x;
+}
diff --git a/c_compiler/test/in/15.c b/c_compiler/test/in/15.c
new file mode 100644
index 0000000..3189b56
--- /dev/null
+++ b/c_compiler/test/in/15.c
@@ -0,0 +1,28 @@
+int add(int a, int b)
+{
+ int c = a + b;
+ return c;
+}
+
+int sub(int a, int b)
+{
+ int c = a - b;
+ return c;
+}
+
+int mult_by_5(int a)
+{
+ int b = 5;
+ return a * b;
+}
+
+int add_5(int a)
+{
+ int i;
+ for(i = 0; i < 5; ++i)
+ {
+ int b = ++a;
+ }
+
+ return a;
+}
diff --git a/c_compiler/test/out/01.diff.txt b/c_compiler/test/out/01.diff.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/c_compiler/test/out/01.diff.txt
diff --git a/c_compiler/test/out/01.pretty.xml b/c_compiler/test/out/01.pretty.xml
new file mode 100644
index 0000000..e0545e4
--- /dev/null
+++ b/c_compiler/test/out/01.pretty.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+<Program>
+ <Variable id="a" />
+ <Variable id="b" />
+ <Variable id="c" />
+ <Variable id="d" />
+ <Variable id="e" />
+ <Variable id="f" />
+</Program>
diff --git a/c_compiler/test/out/01.stderr.txt b/c_compiler/test/out/01.stderr.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/c_compiler/test/out/01.stderr.txt
diff --git a/c_compiler/test/out/01.stdout.txt b/c_compiler/test/out/01.stdout.txt
new file mode 100644
index 0000000..bd7cd1f
--- /dev/null
+++ b/c_compiler/test/out/01.stdout.txt
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+<Program>
+<Variable id="a" />
+<Variable id="b" />
+<Variable id="c" />
+<Variable id="d" />
+<Variable id="e" />
+<Variable id="f" />
+</Program>
diff --git a/c_compiler/test/out/01.stdout.xml b/c_compiler/test/out/01.stdout.xml
new file mode 100644
index 0000000..bd7cd1f
--- /dev/null
+++ b/c_compiler/test/out/01.stdout.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+<Program>
+<Variable id="a" />
+<Variable id="b" />
+<Variable id="c" />
+<Variable id="d" />
+<Variable id="e" />
+<Variable id="f" />
+</Program>
diff --git a/c_compiler/test/out/02.diff.txt b/c_compiler/test/out/02.diff.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/c_compiler/test/out/02.diff.txt
diff --git a/c_compiler/test/out/02.pretty.xml b/c_compiler/test/out/02.pretty.xml
new file mode 100644
index 0000000..1f73bca
--- /dev/null
+++ b/c_compiler/test/out/02.pretty.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<Program>
+ <Function id="f">
+ <Scope></Scope>
+ </Function>
+</Program>
diff --git a/c_compiler/test/out/02.stderr.txt b/c_compiler/test/out/02.stderr.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/c_compiler/test/out/02.stderr.txt
diff --git a/c_compiler/test/out/02.stdout.xml b/c_compiler/test/out/02.stdout.xml
new file mode 100644
index 0000000..bc37d7a
--- /dev/null
+++ b/c_compiler/test/out/02.stdout.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0"?>
+<Program>
+<Function id="f">
+<Scope>
+</Scope>
+</Function>
+</Program>
diff --git a/c_compiler/test/out/03.diff.txt b/c_compiler/test/out/03.diff.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/c_compiler/test/out/03.diff.txt
diff --git a/c_compiler/test/out/03.pretty.xml b/c_compiler/test/out/03.pretty.xml
new file mode 100644
index 0000000..6ab6ab3
--- /dev/null
+++ b/c_compiler/test/out/03.pretty.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0"?>
+<Program>
+ <Function id="foo">
+ <Parameter id="bar" />
+ <Scope></Scope>
+ </Function>
+</Program>
diff --git a/c_compiler/test/out/03.stderr.txt b/c_compiler/test/out/03.stderr.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/c_compiler/test/out/03.stderr.txt
diff --git a/c_compiler/test/out/03.stdout.xml b/c_compiler/test/out/03.stdout.xml
new file mode 100644
index 0000000..6ca0ab2
--- /dev/null
+++ b/c_compiler/test/out/03.stdout.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<Program>
+<Function id="foo">
+<Parameter id="bar" />
+<Scope>
+</Scope>
+</Function>
+</Program>
diff --git a/c_compiler/test/out/04.diff.txt b/c_compiler/test/out/04.diff.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/c_compiler/test/out/04.diff.txt
diff --git a/c_compiler/test/out/04.pretty.xml b/c_compiler/test/out/04.pretty.xml
new file mode 100644
index 0000000..caae53b
--- /dev/null
+++ b/c_compiler/test/out/04.pretty.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<Program>
+ <Function id="foo">
+ <Parameter id="bar1" />
+ <Parameter id="bar2" />
+ <Scope>
+ <Variable id="x" />
+ <Variable id="y" />
+ <Variable id="z" />
+ </Scope>
+ </Function>
+</Program>
diff --git a/c_compiler/test/out/04.stderr.txt b/c_compiler/test/out/04.stderr.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/c_compiler/test/out/04.stderr.txt
diff --git a/c_compiler/test/out/04.stdout.xml b/c_compiler/test/out/04.stdout.xml
new file mode 100644
index 0000000..9257eac
--- /dev/null
+++ b/c_compiler/test/out/04.stdout.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<Program>
+<Function id="foo">
+<Parameter id="bar1" />
+<Parameter id="bar2" />
+<Scope>
+<Variable id="x" />
+<Variable id="y" />
+<Variable id="z" />
+</Scope>
+</Function>
+</Program>
diff --git a/c_compiler/test/out/05.diff.txt b/c_compiler/test/out/05.diff.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/c_compiler/test/out/05.diff.txt
diff --git a/c_compiler/test/out/05.pretty.xml b/c_compiler/test/out/05.pretty.xml
new file mode 100644
index 0000000..944d950
--- /dev/null
+++ b/c_compiler/test/out/05.pretty.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<Program>
+ <Function id="foo">
+ <Parameter id="x" />
+ <Parameter id="y" />
+ <Scope>
+ <Scope></Scope>
+ </Scope>
+ </Function>
+</Program>
diff --git a/c_compiler/test/out/05.stderr.txt b/c_compiler/test/out/05.stderr.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/c_compiler/test/out/05.stderr.txt
diff --git a/c_compiler/test/out/05.stdout.xml b/c_compiler/test/out/05.stdout.xml
new file mode 100644
index 0000000..7381e51
--- /dev/null
+++ b/c_compiler/test/out/05.stdout.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<Program>
+<Function id="foo">
+<Parameter id="x" />
+<Parameter id="y" />
+<Scope>
+<Scope>
+</Scope>
+</Scope>
+</Function>
+</Program>
diff --git a/c_compiler/test/out/06.diff.txt b/c_compiler/test/out/06.diff.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/c_compiler/test/out/06.diff.txt
diff --git a/c_compiler/test/out/06.pretty.xml b/c_compiler/test/out/06.pretty.xml
new file mode 100644
index 0000000..6422001
--- /dev/null
+++ b/c_compiler/test/out/06.pretty.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<Program>
+ <Function id="f">
+ <Parameter id="a" />
+ <Parameter id="b" />
+ <Parameter id="c" />
+ <Scope>
+ <Variable id="d" />
+ <Scope>
+ <Variable id="e" />
+ </Scope>
+ </Scope>
+ </Function>
+</Program>
diff --git a/c_compiler/test/out/06.stderr.txt b/c_compiler/test/out/06.stderr.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/c_compiler/test/out/06.stderr.txt
diff --git a/c_compiler/test/out/06.stdout.xml b/c_compiler/test/out/06.stdout.xml
new file mode 100644
index 0000000..fbcbebd
--- /dev/null
+++ b/c_compiler/test/out/06.stdout.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<Program>
+<Function id="f">
+<Parameter id="a" />
+<Parameter id="b" />
+<Parameter id="c" />
+<Scope>
+<Variable id="d" />
+<Scope>
+<Variable id="e" />
+</Scope>
+</Scope>
+</Function>
+</Program>
diff --git a/c_compiler/test/out/07.diff.txt b/c_compiler/test/out/07.diff.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/c_compiler/test/out/07.diff.txt
diff --git a/c_compiler/test/out/07.pretty.xml b/c_compiler/test/out/07.pretty.xml
new file mode 100644
index 0000000..11c3b77
--- /dev/null
+++ b/c_compiler/test/out/07.pretty.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<Program>
+ <Function id="foo">
+ <Parameter id="a" />
+ <Scope>
+ <Scope>
+ <Variable id="z" />
+ </Scope>
+ </Scope>
+ </Function>
+</Program>
diff --git a/c_compiler/test/out/07.stderr.txt b/c_compiler/test/out/07.stderr.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/c_compiler/test/out/07.stderr.txt
diff --git a/c_compiler/test/out/07.stdout.xml b/c_compiler/test/out/07.stdout.xml
new file mode 100644
index 0000000..ff0efb2
--- /dev/null
+++ b/c_compiler/test/out/07.stdout.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<Program>
+<Function id="foo">
+<Parameter id="a" />
+<Scope>
+<Scope>
+<Variable id="z" />
+</Scope>
+</Scope>
+</Function>
+</Program>
diff --git a/c_compiler/test/out/08.diff.txt b/c_compiler/test/out/08.diff.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/c_compiler/test/out/08.diff.txt
diff --git a/c_compiler/test/out/08.pretty.xml b/c_compiler/test/out/08.pretty.xml
new file mode 100644
index 0000000..6cf0f8e
--- /dev/null
+++ b/c_compiler/test/out/08.pretty.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<Program>
+ <Function id="func">
+ <Parameter id="a" />
+ <Parameter id="b" />
+ <Scope>
+ <Variable id="c" />
+ <Scope>
+ <Variable id="d" />
+ </Scope>
+ <Scope>
+ <Variable id="e" />
+ </Scope>
+ </Scope>
+ </Function>
+</Program>
diff --git a/c_compiler/test/out/08.stderr.txt b/c_compiler/test/out/08.stderr.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/c_compiler/test/out/08.stderr.txt
diff --git a/c_compiler/test/out/08.stdout.xml b/c_compiler/test/out/08.stdout.xml
new file mode 100644
index 0000000..7929e75
--- /dev/null
+++ b/c_compiler/test/out/08.stdout.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<Program>
+<Function id="func">
+<Parameter id="a" />
+<Parameter id="b" />
+<Scope>
+<Variable id="c" />
+<Scope>
+<Variable id="d" />
+</Scope>
+<Scope>
+<Variable id="e" />
+</Scope>
+</Scope>
+</Function>
+</Program>
diff --git a/c_compiler/test/out/09.diff.txt b/c_compiler/test/out/09.diff.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/c_compiler/test/out/09.diff.txt
diff --git a/c_compiler/test/out/09.pretty.xml b/c_compiler/test/out/09.pretty.xml
new file mode 100644
index 0000000..6c137df
--- /dev/null
+++ b/c_compiler/test/out/09.pretty.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0"?>
+<Program>
+ <Function id="x">
+ <Scope></Scope>
+ </Function>
+ <Variable id="g" />
+ <Function id="zz">
+ <Parameter id="a" />
+ <Parameter id="b" />
+ <Parameter id="c" />
+ <Scope>
+ <Scope>
+ <Variable id="a" />
+ </Scope>
+ <Scope>
+ <Variable id="fsdfsdfs" />
+ </Scope>
+ </Scope>
+ </Function>
+</Program>
diff --git a/c_compiler/test/out/09.stderr.txt b/c_compiler/test/out/09.stderr.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/c_compiler/test/out/09.stderr.txt
diff --git a/c_compiler/test/out/09.stdout.xml b/c_compiler/test/out/09.stdout.xml
new file mode 100644
index 0000000..7a7a770
--- /dev/null
+++ b/c_compiler/test/out/09.stdout.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<Program>
+<Function id="x">
+<Scope>
+</Scope>
+</Function>
+<Variable id="g" />
+<Function id="zz">
+<Parameter id="a" />
+<Parameter id="b" />
+<Parameter id="c" />
+<Scope>
+<Scope>
+<Variable id="a" />
+</Scope>
+<Scope>
+<Variable id="fsdfsdfs" />
+</Scope>
+</Scope>
+</Function>
+</Program>
diff --git a/c_compiler/test/out/10.diff.txt b/c_compiler/test/out/10.diff.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/c_compiler/test/out/10.diff.txt
diff --git a/c_compiler/test/out/10.pretty.xml b/c_compiler/test/out/10.pretty.xml
new file mode 100644
index 0000000..89a6292
--- /dev/null
+++ b/c_compiler/test/out/10.pretty.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0"?>
+<Program>
+ <Function id="f">
+ <Scope></Scope>
+ </Function>
+ <Variable id="g" />
+ <Function id="x">
+ <Parameter id="y" />
+ <Scope>
+ <Variable id="z" />
+ <Scope>
+ <Variable id="r" />
+ </Scope>
+ <Scope>
+ <Variable id="f" />
+ </Scope>
+ </Scope>
+ </Function>
+</Program>
diff --git a/c_compiler/test/out/10.stderr.txt b/c_compiler/test/out/10.stderr.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/c_compiler/test/out/10.stderr.txt
diff --git a/c_compiler/test/out/10.stdout.xml b/c_compiler/test/out/10.stdout.xml
new file mode 100644
index 0000000..b07997e
--- /dev/null
+++ b/c_compiler/test/out/10.stdout.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0"?>
+<Program>
+<Function id="f">
+<Scope>
+</Scope>
+</Function>
+<Variable id="g" />
+<Function id="x">
+<Parameter id="y" />
+<Scope>
+<Variable id="z" />
+<Scope>
+<Variable id="r" />
+</Scope>
+<Scope>
+<Variable id="f" />
+</Scope>
+</Scope>
+</Function>
+</Program>
diff --git a/c_compiler/test/out/11.diff.txt b/c_compiler/test/out/11.diff.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/c_compiler/test/out/11.diff.txt
diff --git a/c_compiler/test/out/11.pretty.xml b/c_compiler/test/out/11.pretty.xml
new file mode 100644
index 0000000..b9779d7
--- /dev/null
+++ b/c_compiler/test/out/11.pretty.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<Program>
+ <Function id="f">
+ <Scope>
+ <Variable id="x" />
+ <Scope>
+ <Variable id="y" />
+ </Scope>
+ </Scope>
+ </Function>
+</Program>
diff --git a/c_compiler/test/out/11.stderr.txt b/c_compiler/test/out/11.stderr.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/c_compiler/test/out/11.stderr.txt
diff --git a/c_compiler/test/out/11.stdout.xml b/c_compiler/test/out/11.stdout.xml
new file mode 100644
index 0000000..0822742
--- /dev/null
+++ b/c_compiler/test/out/11.stdout.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<Program>
+<Function id="f">
+<Scope>
+<Variable id="x" />
+<Scope>
+<Variable id="y" />
+</Scope>
+</Scope>
+</Function>
+</Program>
diff --git a/c_compiler/test/out/12.diff.txt b/c_compiler/test/out/12.diff.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/c_compiler/test/out/12.diff.txt
diff --git a/c_compiler/test/out/12.pretty.xml b/c_compiler/test/out/12.pretty.xml
new file mode 100644
index 0000000..9f49265
--- /dev/null
+++ b/c_compiler/test/out/12.pretty.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<Program>
+ <Function id="f">
+ <Parameter id="b" />
+ <Parameter id="c" />
+ <Scope>
+ <Variable id="a" />
+ </Scope>
+ </Function>
+</Program>
diff --git a/c_compiler/test/out/12.stderr.txt b/c_compiler/test/out/12.stderr.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/c_compiler/test/out/12.stderr.txt
diff --git a/c_compiler/test/out/12.stdout.xml b/c_compiler/test/out/12.stdout.xml
new file mode 100644
index 0000000..471f225
--- /dev/null
+++ b/c_compiler/test/out/12.stdout.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<Program>
+<Function id="f">
+<Parameter id="b" />
+<Parameter id="c" />
+<Scope>
+<Variable id="a" />
+</Scope>
+</Function>
+</Program>
diff --git a/c_compiler/test/out/13.diff.txt b/c_compiler/test/out/13.diff.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/c_compiler/test/out/13.diff.txt
diff --git a/c_compiler/test/out/13.pretty.xml b/c_compiler/test/out/13.pretty.xml
new file mode 100644
index 0000000..a604ecd
--- /dev/null
+++ b/c_compiler/test/out/13.pretty.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+<Program>
+ <Function id="func">
+ <Parameter id="x" />
+ <Parameter id="y" />
+ <Scope>
+ <Variable id="i" />
+ <Scope>
+ <Variable id="z" />
+ </Scope>
+ </Scope>
+ </Function>
+</Program>
diff --git a/c_compiler/test/out/13.stderr.txt b/c_compiler/test/out/13.stderr.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/c_compiler/test/out/13.stderr.txt
diff --git a/c_compiler/test/out/13.stdout.xml b/c_compiler/test/out/13.stdout.xml
new file mode 100644
index 0000000..511d93b
--- /dev/null
+++ b/c_compiler/test/out/13.stdout.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+<Program>
+<Function id="func">
+<Parameter id="x" />
+<Parameter id="y" />
+<Scope>
+<Variable id="i" />
+<Scope>
+<Variable id="z" />
+</Scope>
+</Scope>
+</Function>
+</Program>
diff --git a/c_compiler/test/out/14.diff.txt b/c_compiler/test/out/14.diff.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/c_compiler/test/out/14.diff.txt
diff --git a/c_compiler/test/out/14.pretty.xml b/c_compiler/test/out/14.pretty.xml
new file mode 100644
index 0000000..866d44e
--- /dev/null
+++ b/c_compiler/test/out/14.pretty.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+<Program>
+ <Function id="function_1">
+ <Parameter id="a" />
+ <Parameter id="b" />
+ <Scope>
+ <Variable id="x" />
+ <Scope>
+ <Variable id="c" />
+ </Scope>
+ </Scope>
+ </Function>
+</Program>
diff --git a/c_compiler/test/out/14.stderr.txt b/c_compiler/test/out/14.stderr.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/c_compiler/test/out/14.stderr.txt
diff --git a/c_compiler/test/out/14.stdout.xml b/c_compiler/test/out/14.stdout.xml
new file mode 100644
index 0000000..1b412d3
--- /dev/null
+++ b/c_compiler/test/out/14.stdout.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+<Program>
+<Function id="function_1">
+<Parameter id="a" />
+<Parameter id="b" />
+<Scope>
+<Variable id="x" />
+<Scope>
+<Variable id="c" />
+</Scope>
+</Scope>
+</Function>
+</Program>
diff --git a/c_compiler/test/out/15.diff.txt b/c_compiler/test/out/15.diff.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/c_compiler/test/out/15.diff.txt
diff --git a/c_compiler/test/out/15.pretty.xml b/c_compiler/test/out/15.pretty.xml
new file mode 100644
index 0000000..b06dde0
--- /dev/null
+++ b/c_compiler/test/out/15.pretty.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0"?>
+<Program>
+ <Function id="add">
+ <Parameter id="a" />
+ <Parameter id="b" />
+ <Scope>
+ <Variable id="c" />
+ </Scope>
+ </Function>
+ <Function id="sub">
+ <Parameter id="a" />
+ <Parameter id="b" />
+ <Scope>
+ <Variable id="c" />
+ </Scope>
+ </Function>
+ <Function id="mult_by_5">
+ <Parameter id="a" />
+ <Scope>
+ <Variable id="b" />
+ </Scope>
+ </Function>
+ <Function id="add_5">
+ <Parameter id="a" />
+ <Scope>
+ <Variable id="i" />
+ <Scope>
+ <Variable id="b" />
+ </Scope>
+ </Scope>
+ </Function>
+</Program>
diff --git a/c_compiler/test/out/15.stderr.txt b/c_compiler/test/out/15.stderr.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/c_compiler/test/out/15.stderr.txt
diff --git a/c_compiler/test/out/15.stdout.xml b/c_compiler/test/out/15.stdout.xml
new file mode 100644
index 0000000..d4c29b2
--- /dev/null
+++ b/c_compiler/test/out/15.stdout.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0"?>
+<Program>
+<Function id="add">
+<Parameter id="a" />
+<Parameter id="b" />
+<Scope>
+<Variable id="c" />
+</Scope>
+</Function>
+<Function id="sub">
+<Parameter id="a" />
+<Parameter id="b" />
+<Scope>
+<Variable id="c" />
+</Scope>
+</Function>
+<Function id="mult_by_5">
+<Parameter id="a" />
+<Scope>
+<Variable id="b" />
+</Scope>
+</Function>
+<Function id="add_5">
+<Parameter id="a" />
+<Scope>
+<Variable id="i" />
+<Scope>
+<Variable id="b" />
+</Scope>
+</Scope>
+</Function>
+</Program>
diff --git a/c_compiler/test/ref/01.stdout.xml b/c_compiler/test/ref/01.stdout.xml
new file mode 100644
index 0000000..e0545e4
--- /dev/null
+++ b/c_compiler/test/ref/01.stdout.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+<Program>
+ <Variable id="a" />
+ <Variable id="b" />
+ <Variable id="c" />
+ <Variable id="d" />
+ <Variable id="e" />
+ <Variable id="f" />
+</Program>
diff --git a/c_compiler/test/ref/02.stdout.xml b/c_compiler/test/ref/02.stdout.xml
new file mode 100644
index 0000000..6caf2fc
--- /dev/null
+++ b/c_compiler/test/ref/02.stdout.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0"?>
+<Program>
+ <Function id="f">
+ <Scope>
+ </Scope>
+ </Function>
+</Program>
diff --git a/c_compiler/test/ref/03.stdout.xml b/c_compiler/test/ref/03.stdout.xml
new file mode 100644
index 0000000..2c29a50
--- /dev/null
+++ b/c_compiler/test/ref/03.stdout.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<Program>
+ <Function id="foo">
+ <Parameter id="bar" />
+ <Scope>
+ </Scope>
+ </Function>
+</Program>
diff --git a/c_compiler/test/ref/04.stdout.xml b/c_compiler/test/ref/04.stdout.xml
new file mode 100644
index 0000000..caae53b
--- /dev/null
+++ b/c_compiler/test/ref/04.stdout.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<Program>
+ <Function id="foo">
+ <Parameter id="bar1" />
+ <Parameter id="bar2" />
+ <Scope>
+ <Variable id="x" />
+ <Variable id="y" />
+ <Variable id="z" />
+ </Scope>
+ </Function>
+</Program>
diff --git a/c_compiler/test/ref/05.stdout.xml b/c_compiler/test/ref/05.stdout.xml
new file mode 100644
index 0000000..f4b306f
--- /dev/null
+++ b/c_compiler/test/ref/05.stdout.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<Program>
+ <Function id="foo">
+ <Parameter id="x" />
+ <Parameter id="y" />
+ <Scope>
+ <Scope>
+ </Scope>
+ </Scope>
+ </Function>
+</Program>
diff --git a/c_compiler/test/ref/06.stdout.xml b/c_compiler/test/ref/06.stdout.xml
new file mode 100644
index 0000000..3526139
--- /dev/null
+++ b/c_compiler/test/ref/06.stdout.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<Program>
+ <Function id="f">
+ <Parameter id="a" />
+ <Parameter id="b" />
+ <Parameter id="c" />
+ <Scope>
+ <Variable id="d" />
+ <Scope>
+ <Variable id="e" />
+ </Scope>
+ </Scope>
+ </Function>
+</Program>
diff --git a/c_compiler/test/ref/07.stdout.xml b/c_compiler/test/ref/07.stdout.xml
new file mode 100644
index 0000000..17c7c1b
--- /dev/null
+++ b/c_compiler/test/ref/07.stdout.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<Program>
+ <Function id="foo">
+ <Parameter id="a" />
+ <Scope>
+ <Scope>
+ <Variable id="z" />
+ </Scope>
+ </Scope>
+ </Function>
+</Program>
diff --git a/c_compiler/test/ref/08.stdout.xml b/c_compiler/test/ref/08.stdout.xml
new file mode 100644
index 0000000..0838fe5
--- /dev/null
+++ b/c_compiler/test/ref/08.stdout.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<Program>
+ <Function id="func">
+ <Parameter id="a" />
+ <Parameter id="b" />
+ <Scope>
+ <Variable id="c" />
+ <Scope>
+ <Variable id="d" />
+ </Scope>
+ <Scope>
+ <Variable id="e" />
+ </Scope>
+ </Scope>
+ </Function>
+</Program>
diff --git a/c_compiler/test/ref/09.stdout.xml b/c_compiler/test/ref/09.stdout.xml
new file mode 100644
index 0000000..646cd98
--- /dev/null
+++ b/c_compiler/test/ref/09.stdout.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<Program>
+ <Function id="x">
+ <Scope>
+ </Scope>
+ </Function>
+ <Variable id="g" />
+ <Function id="zz">
+ <Parameter id="a" />
+ <Parameter id="b" />
+ <Parameter id="c" />
+ <Scope>
+ <Scope>
+ <Variable id="a" />
+ </Scope>
+ <Scope>
+ <Variable id="fsdfsdfs" />
+ </Scope>
+ </Scope>
+ </Function>
+</Program>
diff --git a/c_compiler/test/ref/10.stdout.xml b/c_compiler/test/ref/10.stdout.xml
new file mode 100644
index 0000000..21cadeb
--- /dev/null
+++ b/c_compiler/test/ref/10.stdout.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0"?>
+<Program>
+ <Function id="f">
+ <Scope>
+ </Scope>
+ </Function>
+ <Variable id="g" />
+ <Function id="x">
+ <Parameter id="y" />
+ <Scope>
+ <Variable id="z" />
+ <Scope>
+ <Variable id="r" />
+ </Scope>
+ <Scope>
+ <Variable id="f" />
+ </Scope>
+ </Scope>
+ </Function>
+</Program>
diff --git a/c_compiler/test/ref/11.stdout.xml b/c_compiler/test/ref/11.stdout.xml
new file mode 100644
index 0000000..ad96d6c
--- /dev/null
+++ b/c_compiler/test/ref/11.stdout.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<Program>
+ <Function id="f">
+ <Scope>
+ <Variable id="x" />
+ <Scope>
+ <Variable id="y" />
+ </Scope>
+ </Scope>
+ </Function>
+</Program>
diff --git a/c_compiler/test/ref/12.stdout.xml b/c_compiler/test/ref/12.stdout.xml
new file mode 100644
index 0000000..9f49265
--- /dev/null
+++ b/c_compiler/test/ref/12.stdout.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<Program>
+ <Function id="f">
+ <Parameter id="b" />
+ <Parameter id="c" />
+ <Scope>
+ <Variable id="a" />
+ </Scope>
+ </Function>
+</Program>
diff --git a/c_compiler/test/ref/13.stdout.xml b/c_compiler/test/ref/13.stdout.xml
new file mode 100644
index 0000000..f0385cb
--- /dev/null
+++ b/c_compiler/test/ref/13.stdout.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+<Program>
+ <Function id="func">
+ <Parameter id="x" />
+ <Parameter id="y" />
+ <Scope>
+ <Variable id="i" />
+ <Scope>
+ <Variable id="z" />
+ </Scope>
+ </Scope>
+ </Function>
+</Program>
diff --git a/c_compiler/test/ref/14.stdout.xml b/c_compiler/test/ref/14.stdout.xml
new file mode 100644
index 0000000..63aec85
--- /dev/null
+++ b/c_compiler/test/ref/14.stdout.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+<Program>
+ <Function id="function_1">
+ <Parameter id="a" />
+ <Parameter id="b" />
+ <Scope>
+ <Variable id="x" />
+ <Scope>
+ <Variable id="c" />
+ </Scope>
+ </Scope>
+ </Function>
+</Program>
diff --git a/c_compiler/test/ref/15.stdout.xml b/c_compiler/test/ref/15.stdout.xml
new file mode 100644
index 0000000..029ccb8
--- /dev/null
+++ b/c_compiler/test/ref/15.stdout.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0"?>
+<Program>
+ <Function id="add">
+ <Parameter id="a" />
+ <Parameter id="b" />
+ <Scope>
+ <Variable id="c" />
+ </Scope>
+ </Function>
+ <Function id="sub">
+ <Parameter id="a" />
+ <Parameter id="b" />
+ <Scope>
+ <Variable id="c" />
+ </Scope>
+ </Function>
+ <Function id="mult_by_5">
+ <Parameter id="a" />
+ <Scope>
+ <Variable id="b" />
+ </Scope>
+ </Function>
+ <Function id="add_5">
+ <Parameter id="a" />
+ <Scope>
+ <Variable id="i" />
+ <Scope>
+ <Variable id="b" />
+ </Scope>
+ </Scope>
+ </Function>
+</Program>