Skip to content

add all previous tests to codeb #8

Merged
merged 1 commit into from May 15, 2012
Jump to file
+228 −0
View
1 codeb/argstyle1.0
@@ -0,0 +1 @@
+f(a, b,) end ;
View
2 codeb/argstyle1.call
@@ -0,0 +1,2 @@
+extern long f(long, long);
+RET(f(42, 42) == 0);
View
1 codeb/argstyle2.0
@@ -0,0 +1 @@
+f(a, b) end ;
View
2 codeb/argstyle2.call
@@ -0,0 +1,2 @@
+extern long f(long, long);
+RET(f(42,42) == 0);
View
1 codeb/argstyle3.0
@@ -0,0 +1 @@
+f(a) end ;
View
2 codeb/argstyle3.call
@@ -0,0 +1,2 @@
+extern long f(long);
+RET(f(42) == 0);
View
4 codeb/basicfunc.0
@@ -0,0 +1,4 @@
+add(a, b)
+in:
+ return a + b;
+end;
View
2 codeb/basicfunc.call
@@ -0,0 +1,2 @@
+extern long add(long, long);
+RET(add(-1,2) == 1 && add(42, 42) == 84);
View
4 codeb/basicfuncmultiplelabels.0
@@ -0,0 +1,4 @@
+add(a, b)
+in:out:test:
+ return a + b;
+end;
View
2 codeb/basicfuncmultiplelabels.call
@@ -0,0 +1,2 @@
+extern long add(long, long);
+RET(add(-1,2) == 1 && add(42, 42) == 84);
View
5 codeb/basicfuncmultiplelabels1.0
@@ -0,0 +1,5 @@
+add(a, b)
+in:out:
+test:
+ return a + b;
+end;
View
2 codeb/basicfuncmultiplelabels1.call
@@ -0,0 +1,2 @@
+extern long add(long, long);
+RET(add(-1,2) == 1 && add(42, 42) == 84);
View
15 codeb/basicfuncwitherrors.2
@@ -0,0 +1,15 @@
+sum(array, size)
+base_case:
+ (* i == 0
+ we're done
+ *)
+
+ if not (i # 0) then
+ return 0
+ end;
+
+out:
+ (* recurse into sum *)
+ return (*array) + sum(array + 1, size + -1);
+
+end;
View
6 codeb/basicif.0
@@ -0,0 +1,6 @@
+f(a, b)
+ if (a =< b) then
+ b = a;
+ end;
+ return b;
+end;
View
3 codeb/basicif.call
@@ -0,0 +1,3 @@
+extern long f(long, long);
+RET(f(3, 5) == 3 && f(5, 3) == 3);
+
View
3 codeb/constant_folding.0
@@ -0,0 +1,3 @@
+f(a)
+ return 4 + (a + (2 + ((a + 1) + 3)));
+end;
View
2 codeb/constant_folding.call
@@ -0,0 +1,2 @@
+extern long f(long);
+RET(f(0) == 10L && f(1) == 12L && f(-10) == -10L && f(30) == 70L);
View
3 codeb/constant_folding2.0
@@ -0,0 +1,3 @@
+f(a)
+ return 4 * (a * (2 * ((a * 1) * 3)));
+end;
View
2 codeb/constant_folding2.call
@@ -0,0 +1,2 @@
+extern long f(long);
+RET(f(0) == 0L && f(1) == 24L && f(-10) == 2400L && f(30) == 21600L);
View
3 codeb/dereference.0
@@ -0,0 +1,3 @@
+f(a)
+ return *a;
+end;
View
4 codeb/dereference.call
@@ -0,0 +1,4 @@
+extern long f(long);
+long test = 42;
+RET( f(&test) == 42 );
+
View
3 codeb/dereference2.0
@@ -0,0 +1,3 @@
+f(a, b)
+ return *(a + (b * 8));
+end;
View
4 codeb/dereference2.call
@@ -0,0 +1,4 @@
+extern long f(long, long);
+long test[2] = { 20, 10};
+RET( f(test, 0) == 20 && f(test, 1) == 10);
+
View
6 codeb/exprtest.2
@@ -0,0 +1,6 @@
+add(a, b)
+in:
+ x = a;
+ a = a + b + (c * d) * d;
+ return a + (b*d);
+end;
View
2 codeb/funcdefduplicates.3
@@ -0,0 +1,2 @@
+f(a, b, a)
+end;
View
4 codeb/funcdefduplicates2.3
@@ -0,0 +1,4 @@
+f()
+ var a = 0;
+ var a = 0;
+end;
View
2 codeb/invalidchar.1
@@ -0,0 +1,2 @@
+f(a, b,) end ;
+?
View
1 codeb/invalidchars.1
@@ -0,0 +1 @@
+!@%@
View
5 codeb/invalidexpr.2
@@ -0,0 +1,5 @@
+add(a, b)
+in:
+ alf =< tst;
+
+end;
View
5 codeb/invalidexpr2.2
@@ -0,0 +1,5 @@
+add(a, b)
+in:
+ c = alf =< tst =< alf ;
+
+end;
View
1 codeb/invalidopencomment.2
@@ -0,0 +1 @@
+(* %
View
9 codeb/labelinmultiplefuncs.0
@@ -0,0 +1,9 @@
+f()
+a:
+ return 0;
+end;
+
+g()
+a:
+ return 0;
+end;
View
3 codeb/labelinmultiplefuncs.call
@@ -0,0 +1,3 @@
+extern long f();
+extern long g();
+RET(f() == 0 && g() == 0);
View
1 codeb/loneampersand.1
@@ -0,0 +1 @@
+&
View
1 codeb/lonedecnumber.2
@@ -0,0 +1 @@
+&42
View
1 codeb/lonehexnumber.2
@@ -0,0 +1 @@
+042
View
3 codeb/lonelabel.2
@@ -0,0 +1,3 @@
+add(a, b)
+in:
+end;
View
1 codeb/lonesemicolon.2
@@ -0,0 +1 @@
+;
View
5 codeb/multiplefuncs.0
@@ -0,0 +1,5 @@
+f()
+end;
+
+g()
+end;
View
3 codeb/multiplefuncs.call
@@ -0,0 +1,3 @@
+extern long f();
+extern long g();
+RET(f() == 0 && g() == 0);
View
11 codeb/multiplefuncsconflictingnames.0
@@ -0,0 +1,11 @@
+f(a)
+ return a;
+end;
+
+g(a)
+ return a;
+end;
+
+h(a)
+ return a;
+end;
View
4 codeb/multiplefuncsconflictingnames.call
@@ -0,0 +1,4 @@
+extern long f(long);
+extern long g(long);
+extern long h(long);
+RET(f(0) == 0 && g(1) == 1 && h(2) == 2);
View
3 codeb/parameter_usage.0
@@ -0,0 +1,3 @@
+f(a)
+ return (a+(a+(a+(a+(a+a)))));
+end;
View
2 codeb/parameter_usage.call
@@ -0,0 +1,2 @@
+extern long f(long);
+RET(f(0) == 0L && f(1) == 6L && f(-10) == -60L);
View
1 codeb/partialfuncdef.2
@@ -0,0 +1 @@
+f()
View
1 codeb/partialfuncdef2.2
@@ -0,0 +1 @@
+f(a b)
View
6 codeb/redefinitioninifs2.3
@@ -0,0 +1,6 @@
+f(a,b)
+ if a =< b then
+ var x = y * 3;
+ end;
+ var x = 34;
+end;
View
4 codeb/redefinitionlabelvar.3
@@ -0,0 +1,4 @@
+f()
+a:
+ var a = 0;
+end;
View
6 codeb/returninmiddle.0
@@ -0,0 +1,6 @@
+f(a, b)
+ if (a =< b) then
+ return a;
+ end;
+ return b;
+end;
View
2 codeb/returninmiddle.call
@@ -0,0 +1,2 @@
+extern long f(long, long);
+RET(f(1, 2) == 1 && f(2, 1) == 1);
View
3 codeb/simplefunc.0
@@ -0,0 +1,3 @@
+f(a, b, c)
+ return not a;
+end;
View
2 codeb/simplefunc.call
@@ -0,0 +1,2 @@
+extern long f(long, long, long);
+RET(f(0, 0, 0) == -1L && f(42, 24, 123) == -43);
View
3 codeb/simplefunc1.0
@@ -0,0 +1,3 @@
+f(a, b, c)
+ return - a;
+end;
View
2 codeb/simplefunc1.call
@@ -0,0 +1,2 @@
+extern long f(long, long, long);
+RET(f(42, 0, 0) == -42 && f(0, 24, 123) == 0);
View
3 codeb/simplefunc2.0
@@ -0,0 +1,3 @@
+f(a, b, c)
+ return - not not - a;
+end;
View
2 codeb/simplefunc2.call
@@ -0,0 +1,2 @@
+extern long f(long, long, long);
+RET(f(42, 0, 0) == 42 && f(0, 24, 123) == 0);
View
3 codeb/simplefunc3.0
@@ -0,0 +1,3 @@
+f(a, b, c)
+ return a + (b * c);
+end;
View
2 codeb/simplefunc3.call
@@ -0,0 +1,2 @@
+extern long f(long, long, long);
+RET(f(1, 2, 3) == 7 && f(1, -2, 3) == -5);
View
3 codeb/simplefunc4.0
@@ -0,0 +1,3 @@
+f(a, b, c)
+ return (c and c) + ((a =< 0) and (b # 0));
+end;
View
2 codeb/simplefunc4.call
@@ -0,0 +1,2 @@
+extern long f(long, long, long);
+RET(f(1, 2, 3) == 3 && f(0, 1, 2) == 3);
View
5 codeb/unarryassign1.2
@@ -0,0 +1,5 @@
+add(a, b)
+
+ *not = test;
+
+end;
View
5 codeb/unarryassign2.2
@@ -0,0 +1,5 @@
+add(a, b)
+
+ -i = test;
+
+end;
View
5 codeb/unarryassign3.2
@@ -0,0 +1,5 @@
+add(a, b)
+
+ not i = test;
+
+end;
View
3 codeb/unary_chained.0
@@ -0,0 +1,3 @@
+f(a, b, c)
+ return (not - ((a + b) * c)) + a;
+end;
View
2 codeb/unary_chained.call
@@ -0,0 +1,2 @@
+extern long f(long, long, long);
+RET(f(0, 0, 0) == -1L && f(1, 2, 3) == 9 && f(100, -200, 300) == -29901);
View
3 codeb/undefinedrefincall.3
@@ -0,0 +1,3 @@
+f()
+ f(a);
+end;
View
5 codeb/undefinedrefinif.3
@@ -0,0 +1,5 @@
+f()
+ if (a # 0) then
+ var a = 0;
+ end;
+end;
View
3 codeb/undefinedrefinunary.3
@@ -0,0 +1,3 @@
+f()
+ *a = 0;
+end;
View
3 codeb/undefinedvar.3
@@ -0,0 +1,3 @@
+f()
+ x = 42;
+end;
Something went wrong with that request. Please try again.