aboutsummaryrefslogtreecommitdiffstats
path: root/c_parser/test/in
diff options
context:
space:
mode:
authorYann Herklotz <ymherklotz@gmail.com>2017-02-19 15:31:55 +0000
committerYann Herklotz <ymherklotz@gmail.com>2017-02-19 15:31:55 +0000
commitf820e632c9c985a938f32c4d3adb9bafb3b9393f (patch)
tree8da58b7b3e40f9a96f954b88970f45d5e95e98bc /c_parser/test/in
parent563fc043d2ed88cc72b825e3916287f8a67545c2 (diff)
downloadCompiler-f820e632c9c985a938f32c4d3adb9bafb3b9393f.tar.gz
Compiler-f820e632c9c985a938f32c4d3adb9bafb3b9393f.zip
Nearly all working perfectly
Diffstat (limited to 'c_parser/test/in')
-rw-r--r--c_parser/test/in/04.c4
-rw-r--r--c_parser/test/in/05.c2
-rw-r--r--c_parser/test/in/06.c8
-rw-r--r--c_parser/test/in/07.c6
-rw-r--r--c_parser/test/in/08.c16
-rw-r--r--c_parser/test/in/09.c14
-rw-r--r--c_parser/test/in/10.c22
-rw-r--r--c_parser/test/in/11.c16
-rw-r--r--c_parser/test/in/12.c4
-rw-r--r--c_parser/test/in/13.c8
-rw-r--r--c_parser/test/in/14.c12
-rw-r--r--c_parser/test/in/15.c28
12 files changed, 94 insertions, 46 deletions
diff --git a/c_parser/test/in/04.c b/c_parser/test/in/04.c
index 0e50c88..2e3aa5d 100644
--- a/c_parser/test/in/04.c
+++ b/c_parser/test/in/04.c
@@ -1,4 +1,4 @@
int foo(int bar1, int bar2) {
- int x;
- int y, z;
+ int x;
+ int y, z;
}
diff --git a/c_parser/test/in/05.c b/c_parser/test/in/05.c
index a5ac579..2317163 100644
--- a/c_parser/test/in/05.c
+++ b/c_parser/test/in/05.c
@@ -1,3 +1,3 @@
int foo(int x, int y) {
- {}
+ {}
}
diff --git a/c_parser/test/in/06.c b/c_parser/test/in/06.c
index f182bd9..2dcdc2b 100644
--- a/c_parser/test/in/06.c
+++ b/c_parser/test/in/06.c
@@ -1,6 +1,6 @@
int f(int a, int b, int c) {
- int d;
- {
- int e;
- }
+ int d;
+ {
+ int e;
+ }
}
diff --git a/c_parser/test/in/07.c b/c_parser/test/in/07.c
index 6abb5b5..80d8051 100644
--- a/c_parser/test/in/07.c
+++ b/c_parser/test/in/07.c
@@ -1,5 +1,5 @@
int foo(int a) {
- if(x == y) {
- int z;
- }
+ if(x == y) {
+ int z;
+ }
}
diff --git a/c_parser/test/in/08.c b/c_parser/test/in/08.c
index 3d8e983..c57a6ab 100644
--- a/c_parser/test/in/08.c
+++ b/c_parser/test/in/08.c
@@ -1,10 +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;
+ int c = 0;
+ if(a == b) {
+ int d;
+ } else if(a == d) {
+ int e;
+ return d;
+ }
+ return c;
}
diff --git a/c_parser/test/in/09.c b/c_parser/test/in/09.c
index 08a7ee4..ae86bb1 100644
--- a/c_parser/test/in/09.c
+++ b/c_parser/test/in/09.c
@@ -5,11 +5,11 @@ int g;
int zz(int a, int b, int c)
{
- if(a==b){
- int a;
- return a;
- }else{
- int fsdfsdfs;
- return c;
- }
+ if(a==b){
+ int a;
+ return a;
+ }else{
+ int fsdfsdfs;
+ return c;
+ }
}
diff --git a/c_parser/test/in/10.c b/c_parser/test/in/10.c
index 3d4bb3c..37a6ecc 100644
--- a/c_parser/test/in/10.c
+++ b/c_parser/test/in/10.c
@@ -4,15 +4,15 @@ 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;
+ 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_parser/test/in/11.c b/c_parser/test/in/11.c
index 7b6c0b5..2d8cac6 100644
--- a/c_parser/test/in/11.c
+++ b/c_parser/test/in/11.c
@@ -1,10 +1,10 @@
int f() {
- int x = 0;
-
- while(x < 5) {
- int y = 0;
- x++;
- }
-
- return x;
+ int x = 0;
+
+ while(x < 5) {
+ int y = 0;
+ x++;
+ }
+
+ return x;
}
diff --git a/c_parser/test/in/12.c b/c_parser/test/in/12.c
index bc51045..37b8b7e 100644
--- a/c_parser/test/in/12.c
+++ b/c_parser/test/in/12.c
@@ -1,4 +1,4 @@
int f(int b, int c) {
- int a = b+c;
- return a;
+ int a = b+c;
+ return a;
}
diff --git a/c_parser/test/in/13.c b/c_parser/test/in/13.c
new file mode 100644
index 0000000..d912d70
--- /dev/null
+++ b/c_parser/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_parser/test/in/14.c b/c_parser/test/in/14.c
new file mode 100644
index 0000000..94506d7
--- /dev/null
+++ b/c_parser/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_parser/test/in/15.c b/c_parser/test/in/15.c
new file mode 100644
index 0000000..3189b56
--- /dev/null
+++ b/c_parser/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;
+}