Pārlūkot izejas kodu

Deleted old test suite

Taddeus Kroes 12 gadi atpakaļ
vecāks
revīzija
ad7dc96aa6
73 mainītis faili ar 0 papildinājumiem un 1702 dzēšanām
  1. 0 0
      manual_test/array_assign.cvc
  2. 0 0
      manual_test/array_dim.cvc
  3. 0 0
      manual_test/array_init.cvc
  4. 0 0
      manual_test/array_scope.cvc
  5. 0 0
      manual_test/bool_op.cvc
  6. 0 0
      manual_test/civic.h
  7. 0 0
      manual_test/constant_propagation.cvc
  8. 0 0
      manual_test/context.cvc
  9. 0 0
      manual_test/dim_reduce.cvc
  10. 0 0
      manual_test/extern_vars.cvc
  11. 0 0
      manual_test/for_to_while.cvc
  12. 0 0
      manual_test/peephole.cvc
  13. 0 0
      manual_test/scope.cvc
  14. 0 0
      manual_test/simple.cvc
  15. 0 0
      manual_test/test.cvc
  16. 0 0
      manual_test/var_init.cvc
  17. 0 24
      test/array_init.cvc
  18. 0 13
      test/array_init.out
  19. 0 73
      test/array_single_eval.cvc
  20. 0 12
      test/array_single_eval.out
  21. 0 69
      test/bool_op.cvc
  22. 0 36
      test/bool_op.out
  23. BIN
      test/civ.out
  24. 0 42
      test/for_to_while.cvc
  25. 0 8
      test/for_to_while.out
  26. 0 37
      test/nested_funs.cvc
  27. 0 1
      test/nested_funs.out
  28. 0 9
      test/parsetab.py
  29. 0 23
      test/pi.cvc
  30. 0 1
      test/pi.out
  31. 0 29
      test/prime.cvc
  32. 0 25
      test/prime.out
  33. 0 13
      test/res.out
  34. 0 77
      test/run.bash
  35. 0 8
      test/stdlib.h
  36. 0 60
      test/testsuite/assignment/12_gcd.cvc
  37. 0 80
      test/testsuite/assignment/15_matrixMult.cvc
  38. 0 44
      test/testsuite/assignment/19_prime.cvc
  39. 0 82
      test/testsuite/assignment/1_8_queen.cvc
  40. 0 41
      test/testsuite/assignment/21_print.cvc
  41. 0 91
      test/testsuite/assignment/25_quicksort.cvc
  42. 0 40
      test/testsuite/assignment/28_testfor.cvc
  43. 0 52
      test/testsuite/assignment/2_euclid_f.cvc
  44. 0 40
      test/testsuite/assignment/5_factorial.cvc
  45. 0 4
      test/testsuite/easy_test/test14.cvc
  46. 0 12
      test/testsuite/easy_test/test20.cvc
  47. 0 9
      test/testsuite/easy_test/test30.cvc
  48. 0 6
      test/testsuite/easy_test/test36.cvc
  49. 0 8
      test/testsuite/easy_test/test40.cvc
  50. 0 13
      test/testsuite/easy_test/test46.cvc
  51. 0 4
      test/testsuite/easy_test/test5.cvc
  52. 0 53
      test/testsuite/easy_test/test52.cvc
  53. 0 8
      test/testsuite/easy_test/test59.cvc
  54. 0 15
      test/testsuite/easy_test/test61.cvc
  55. 0 33
      test/testsuite/easy_test/test75.cvc
  56. 0 4
      test/testsuite/easy_test/test78.cvc
  57. 0 35
      test/testsuite/easy_test/test83.cvc
  58. 0 4
      test/testsuite/easy_test/test9.cvc
  59. 0 3
      test/testsuite/error_test/fail11.cvc
  60. 0 1
      test/testsuite/error_test/fail19.cvc
  61. 0 4
      test/testsuite/error_test/fail28.cvc
  62. 0 4
      test/testsuite/error_test/fail34.cvc
  63. 0 4
      test/testsuite/error_test/fail42.cvc
  64. 0 4
      test/testsuite/error_test/fail48.cvc
  65. 0 10
      test/testsuite/error_test/fail55.cvc
  66. 0 15
      test/testsuite/error_test/fail62.cvc
  67. 0 47
      test/testsuite/functional_test/11_mul_add_bool.cvc
  68. 0 47
      test/testsuite/functional_test/14_type_checking_cast.cvc
  69. 0 119
      test/testsuite/functional_test/14_type_checking_cast.s
  70. 0 42
      test/testsuite/functional_test/1_array.cvc
  71. 0 18
      test/testsuite/functional_test/4_arth2.cvc
  72. 0 28
      test/testsuite/functional_test/7_euclides.cvc
  73. 0 118
      test/testsuite/functional_test/9_inner_fun.cvc

+ 0 - 0
test/old/array_assign.cvc → manual_test/array_assign.cvc


+ 0 - 0
test/old/array_dim.cvc → manual_test/array_dim.cvc


+ 0 - 0
test/old/array_init.cvc → manual_test/array_init.cvc


+ 0 - 0
test/old/array_scope.cvc → manual_test/array_scope.cvc


+ 0 - 0
test/old/bool_op.cvc → manual_test/bool_op.cvc


+ 0 - 0
test/old/civic.h → manual_test/civic.h


+ 0 - 0
test/old/constant_propagation.cvc → manual_test/constant_propagation.cvc


+ 0 - 0
test/old/context.cvc → manual_test/context.cvc


+ 0 - 0
test/old/dim_reduce.cvc → manual_test/dim_reduce.cvc


+ 0 - 0
test/old/extern_vars.cvc → manual_test/extern_vars.cvc


+ 0 - 0
test/old/for_to_while.cvc → manual_test/for_to_while.cvc


+ 0 - 0
test/old/peephole.cvc → manual_test/peephole.cvc


+ 0 - 0
test/old/scope.cvc → manual_test/scope.cvc


+ 0 - 0
test/old/simple.cvc → manual_test/simple.cvc


+ 0 - 0
test/old/test.cvc → manual_test/test.cvc


+ 0 - 0
test/old/var_init.cvc → manual_test/var_init.cvc


+ 0 - 24
test/array_init.cvc

@@ -1,24 +0,0 @@
-#include "stdlib.h"
-
-export int main() {
-    int[2,3] a = [[1,2,3], [4,5,6]];
-    int[2,3] b = 7;
-    
-    for(int i=0,2) {
-        for(int j=0,3) {
-            printInt(a[i,j]);
-            printNewlines(1);
-        }
-    }
-    
-    printNewlines(1);
-    
-    for(int i=0,2) {
-        for(int j=0,3) {
-            printInt(b[i,j]);
-            printNewlines(1);
-        }
-    }
-
-    return 0;
-}

+ 0 - 13
test/array_init.out

@@ -1,13 +0,0 @@
-1
-2
-3
-4
-5
-6
-
-7
-7
-7
-7
-7
-7

+ 0 - 73
test/array_single_eval.cvc

@@ -1,73 +0,0 @@
-extern void printInt(int val);
-extern void printSpaces(int num);
-extern void printNewlines(int num);
-
-int ones = 0;
-int twos = 0;
-
-int one() {
-    ones = ones + 1;
-    return 1;
-}
-
-int two() {
-    twos = twos + 1;
-    return 2;
-}
-
-void printArray1D(int[n] a) {
-    for (int i = 0, n) {
-        printInt(a[i]);
-        if (i != n - 1) printSpaces(1);
-    }
-    printNewlines(1);
-}
-
-void printArray2D(int[n, m] a) {
-    for (int i = 0, n) {
-        for (int j = 0, m) {
-            printInt(a[i, j]);
-            if (j != m - 1) printSpaces(1);
-        }
-        printNewlines(1);
-    }
-}
-
-void printArray3D(int[n, m, o] a) {
-    for (int i = 0, n) {
-        for (int j = 0, m) {
-            for (int k = 0, o) {
-                printInt(a[i, j, k]);
-                if (k != o - 1) printSpaces(1);
-            }
-            if (j != m - 1) printSpaces(2);
-        }
-        printNewlines(1);
-    }
-}
-
-export int main() {
-    int[two()] a        = one();
-    int[two(), two()] b = [[1, one()], [2, two()]];
-    int[2, 3] c         = [one(), two()];
-    int[2, 3, 3] d      = [one(), two()];
-
-    printArray1D(a);
-    printNewlines(1);
-
-    printArray2D(b);
-    printNewlines(1);
-
-    printArray2D(c);
-    printNewlines(1);
-
-    printArray3D(d);
-    printNewlines(1);
-
-    printInt(ones);
-    printSpaces(1);
-    printInt(twos);
-    printNewlines(1);
-
-    return 0;
-}

+ 0 - 12
test/array_single_eval.out

@@ -1,12 +0,0 @@
-1 1
-
-1 1
-2 2
-
-1 1 1
-2 2 2
-
-1 1 1  1 1 1  1 1 1
-2 2 2  2 2 2  2 2 2
-
-4 6

+ 0 - 69
test/bool_op.cvc

@@ -1,69 +0,0 @@
-#include "stdlib.h"
-
-void printBool(bool b) {
-    if(b) {
-        printInt(1);
-    } else {
-        printInt(0);
-    }
-
-    printNewlines(1);
-}
-
-bool t() {
-    printInt(1);
-    return true;
-}
-
-bool f() {
-    printInt(0);
-    return false;
-}
-
-export int main() {
-    printBool(t() == f());
-    printBool(f() == t());
-    printBool(t() == t());
-    printBool(f() == f());
-    printNewlines(1);
-
-    printBool(t() != f());
-    printBool(f() != t());
-    printBool(t() != t());
-    printBool(f() != f());
-    printNewlines(1);
-
-    printBool(t() && f());
-    printBool(f() && t());
-    printBool(t() && t());
-    printBool(f() && f());
-    printNewlines(1);
-
-    printBool(t() || f());
-    printBool(f() || t());
-    printBool(t() || t());
-    printBool(f() || f());
-    printNewlines(1);
-
-    printBool(t() * f());
-    printBool(f() * t());
-    printBool(t() * t());
-    printBool(f() * f());
-    printNewlines(1);
-
-    printBool(t() + f());
-    printBool(f() + t());
-    printBool(t() + t());
-    printBool(f() + f());
-    printNewlines(1);
-
-    printBool((bool)5);
-    printBool((bool)0);
-    printNewlines(1);
-
-    printBool((bool)5.0);
-    printBool((bool)0.0);
-    printNewlines(1);
-
-    return 0;
-}

+ 0 - 36
test/bool_op.out

@@ -1,36 +0,0 @@
-100
-010
-111
-001
-
-101
-011
-110
-000
-
-100
-00
-111
-00
-
-11
-011
-11
-000
-
-100
-010
-111
-000
-
-101
-011
-111
-000
-
-1
-0
-
-1
-0
-

BIN
test/civ.out


+ 0 - 42
test/for_to_while.cvc

@@ -1,42 +0,0 @@
-#include "stdlib.h"
-
-export int main() {
-    for(int i=0, 10) {
-        printInt(i);
-        printSpaces(1);
-    }
-    
-    printNewlines(1);
-    
-    for(int i=10, 0,-1) {
-        printInt(i);
-        printSpaces(1);
-    }
-    
-    printNewlines(1);
-    
-    for(int i=0, 10, 2) {
-        printInt(i);
-        printSpaces(1);
-    }
-    
-    printNewlines(1);
-    
-    for(int i=7, 0, -3) {
-        printInt(i);
-        printSpaces(1);
-    }
-    
-    for(int i=0, 5) {
-        for(int j=0, 4) {
-            printInt(i);
-            printSpaces(1);
-            printInt(j);
-            printSpaces(1);
-        }
-        
-        printNewlines(1);
-    }
-
-    return 0;
-}

+ 0 - 8
test/for_to_while.out

@@ -1,8 +0,0 @@
-0 1 2 3 4 5 6 7 8 9
-10 9 8 7 6 5 4 3 2 1
-0 2 4 6 8
-7 4 1 0 0 0 1 0 2 0 3
-1 0 1 1 1 2 1 3
-2 0 2 1 2 2 2 3
-3 0 3 1 3 2 3 3
-4 0 4 1 4 2 4 3

+ 0 - 37
test/nested_funs.cvc

@@ -1,37 +0,0 @@
-extern void printInt(int val);
-
-void foo() {
-    void bar() {
-        void bar() {
-            printInt(1);
-            foobar();  // isrn 1
-        }
-
-        printInt(2);
-        bar();     // isrl
-        baz();     // isrg
-        foobar();  // isr
-    }
-
-    void foobar() {}
-
-    printInt(3);    // isrg
-    bar();          // isrl
-    baz();          // isrg
-}
-
-void bar() {
-    printInt(4);
-}
-
-void baz() {
-    printInt(5);
-    bar();
-}
-
-export int main() {
-    foo();
-    bar();
-    baz();
-    return 0;
-}

+ 0 - 1
test/nested_funs.out

@@ -1 +0,0 @@
-3215454454

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 9
test/parsetab.py


+ 0 - 23
test/pi.cvc

@@ -1,23 +0,0 @@
-#include "stdlib.h"
-
-float computePi() {
-    float pi = 0.0;
-    int n = 75;
-    
-    for(int x=-n, n+1) {
-        for(int y=-n, n+1) {
-            if(x*x + y*y <= n*n) {
-                pi = pi + 1.0/(float)(n*n);
-            }
-        }
-    }
-    
-    return pi;
-}
-
-export int main() {
-    printFloat(computePi());
-    printNewlines(1);
-    
-    return 0;
-}

+ 0 - 1
test/pi.out

@@ -1 +0,0 @@
-3.140444

+ 0 - 29
test/prime.cvc

@@ -1,29 +0,0 @@
-#include "stdlib.h"
-
-int next_prime(int p) {
-    bool is_prime;
-
-    do {
-        p = p + 1;
-        is_prime = true;
-
-        for (int i = 2, p) {
-            if (p % i == 0)
-                is_prime = false;
-        }
-    } while(!is_prime);
-
-    return p;
-}
-
-export int main() {
-    int p = 2;
-
-    for (int i = 0, 25) {
-        printInt(p);
-        printNewlines(1);
-        p = next_prime(p);
-    }
-
-    return 0;
-}

+ 0 - 25
test/prime.out

@@ -1,25 +0,0 @@
-2
-3
-5
-7
-11
-13
-17
-19
-23
-29
-31
-37
-41
-43
-47
-53
-59
-61
-67
-71
-73
-79
-83
-89
-97

+ 0 - 13
test/res.out

@@ -1,13 +0,0 @@
-1
-2
-3
-4
-5
-6
-
-7
-7
-7
-7
-7
-7

+ 0 - 77
test/run.bash

@@ -1,77 +0,0 @@
-#!/usr/bin/env bash
-CIVAS=${CIVAS-../bin32/civas}
-CIVVM=${CIVVM-../bin32/civvm}
-CIVCC=${CIVCC-../civicc}
-REAL_CFLAGS="-v 1"
-TESTSUITE_CFLAGS=
-
-total_tests=0
-failed_tests=0
-
-
-# The real tests: compile a file, run it and compare the output to the
-# output of the reference compiler.
-for f in *.cvc
-do
-    total_tests=$((total_tests+1))
-    echo -n $f:" "
-
-    if $CIVCC $REAL_CFLAGS -o tmp.s $f > tmp.out 2>&1 &&
-       $CIVAS tmp.s -o tmp.o > tmp.out 2>&1 &&
-       $CIVVM tmp.o > tmp.out 2>&1 &&
-       mv tmp.out tmp.res &&
-       diff tmp.res ${f%.*}.out --side-by-side --ignore-space-change > tmp.out 2>&1
-    then
-        echo success
-    else
-        echo failed
-        echo -------------------------------
-        cat tmp.out
-        echo -------------------------------
-        echo
-        failed_tests=$((failed_tests+1))
-    fi
-
-    rm -f tmp.res tmp.s tmp.o tmp.out
-done
-
-
-# Tests from the testsuite. Only check if exit code of compiler equals 0.
-for f in testsuite/assignment/*.cvc testsuite/easy_test/*.cvc testsuite/functional_test/*.cvc
-do
-    total_tests=$((total_tests+1))
-    echo -n $f:" "
-
-    if $CIVCC $TESTSUITE_CFLAGS $f -o tmp.s > /dev/null 2>&1
-    then
-        echo success
-    else
-        echo failed
-        failed_tests=$((failed_tests+1))
-    fi
-
-    rm -f tmp.s
-done
-
-
-# Tests from the testsuite that must fail. Only check if exit code
-# of compiler does not equal 0.
-for f in testsuite/error_test/*.cvc
-do
-    total_tests=$((total_tests+1))
-    echo -n $f:" "
-
-    if $CIVCC $TESTSUITE_CFLAGS $f -o tmp.s > /dev/null 2>&1
-    then
-        echo failed
-        failed_tests=$((failed_tests+1))
-    else
-        echo success
-    fi
-
-    rm -f tmp.s
-done
-
-
-echo
-echo $total_tests tests, $failed_tests failures

+ 0 - 8
test/stdlib.h

@@ -1,8 +0,0 @@
-extern void printInt(int val);
-extern void printFloat(float val);
-
-extern int scanInt(); 
-extern float scanFloat();
-
-extern void printSpaces(int num);
-extern void printNewlines(int num); 

+ 0 - 60
test/testsuite/assignment/12_gcd.cvc

@@ -1,60 +0,0 @@
-/*
- *  gcd.c
- *  
- *
- *  Created by Andrew on 2/5/11.
- *  Copyright 2011 UvA. All rights reserved.
- *
- */
-
-extern void printInt( int val);
-extern void printFloat( float val);
-
-extern int scanInt( );
-extern float scanFloat( );
-
-extern void printSpaces( int num);
-extern void printNewlines( int num);
-
-
-int gcd_cal(int min,int max)
-{
-	int media;
-	if(min>max)
-	{
-		media=min;
-		min=max;
-		max=media;
-	}
-	
-	while(min>0)
-	{
-		max=max-min;
-		if(min>max)
-		{
-			media=min;
-			min=max;
-			max=media;
-		}
-	}
-	return max;
-	
-}
-
-export int main()
-{
-	int max=scanInt();
-	int min=scanInt();
-	
-	int gcd=0;
-	
-	if(max==0||min==0)
-		printInt(gcd);
-	else
-	{
-		gcd=gcd_cal(max,min);	
-		printInt(gcd);
-	}	
-	printNewlines(1);
-	return 0;
-}

+ 0 - 80
test/testsuite/assignment/15_matrixMult.cvc

@@ -1,80 +0,0 @@
-extern void printInt( int val);
-extern void printFloat( float val);
-
-extern int scanInt( );
-extern float scanFloat( );
-
-extern void printSpaces( int num);
-extern void printNewlines( int num);
-
-
-export int main()
-{
-	//Read dimensions of matrix from input
-	int rowsMatrixA =5;
-	int colMatrixA = 5;
-
-	int rowsMatrixB =5;
-	int colMatrixB = 5;
-
-	int[rowsMatrixA, colMatrixA] matrixA;
-	int[rowsMatrixB, colMatrixB] matrixB;
-	int[rowsMatrixA, colMatrixB] matrixProduct;
-
-	//Product cannot be done if the following condition does not stand
-	if (colMatrixA == rowsMatrixB)
-	{
-		//Fill in Matrix A
-		for (int i = 0, rowsMatrixA)
-		{
-			for (int j = 0, colMatrixA)
-			{
-				matrixA[i, j] = i + j;
-				printInt(matrixA[i, j]);
-				printSpaces(3);
-			}
-			printNewlines(1);
-		}
-        printNewlines(1);
-
-		//Fill in Matrix B
-		for (int i = 0, rowsMatrixB)
-		{
-			for (int j = 0, colMatrixB)
-			{
-				matrixB[i, j] = i + j;
-				printInt(matrixB[i, j]);
-				printSpaces(3);
-			}
-			printNewlines(1);
-		}
-        printNewlines(1);
-
-		//Do Multiplication
-		for (int i = 0, rowsMatrixA)
-		{
-			for (int j = 0, colMatrixB)
-			{
-				matrixProduct[i, j] = 0;
-				for (int m = 0, colMatrixA)
-				{
-					matrixProduct[i, j] = matrixProduct[i, j] + (matrixA[i, m] * matrixB[m,j]);
-				}
-			}
-		}
-
-
-		for (int i = 0, rowsMatrixA)
-		{
-			for (int j = 0, colMatrixB)
-			{
-				printInt(matrixProduct[i, j]);
-						printSpaces(3);
-			}
-			printNewlines(1);
-		}
-	}
-	return 0;
-}
-
-

+ 0 - 44
test/testsuite/assignment/19_prime.cvc

@@ -1,44 +0,0 @@
-extern void printInt( int val);
-extern void printFloat( float val);
-
-extern int scanInt( );
-extern float scanFloat( );
-
-extern void printSpaces( int num);
-extern void printNewlines( int num);
-
-export int main() 
-{
-	int num = scanInt();
-	int i;
-	int j;
-	//int sqRoot;
-	bool isPrime;
-	
-	i = 2;
- 	
-	while (i <= num + 1)
-	{
-		j = 2;
-		isPrime = true;
-		
-		while ((j < i-1) && isPrime)
-		{
-			if ((i % j) == 0)
-				isPrime = false;
-			
-			j = j + 1;
-		}
-		
-		if (isPrime)
-		{
-			printInt(i);
-			printNewlines(1);
-		}			
-		else
-			num = num + 1;
-		i= i + 1;
-	}
-	
-	return 0;
-}

+ 0 - 82
test/testsuite/assignment/1_8_queen.cvc

@@ -1,82 +0,0 @@
-/*
- *  quene.c
- *  
- *
- *  Created by Andrew on 2/5/11.
- *  Copyright 2011 UvA. All rights reserved.
- *
- */
-
-extern void printInt( int val);
-extern void printFloat( float val);
-
-extern int scanInt( );
-extern float scanFloat( );
-
-extern void printSpaces( int num);
-extern void printNewlines( int num);
-
-int[8] x;
-
-int abs_sub(int i,int j)
-{
-	int k;
-	if(i>=j)
-		k=i-j;
-	else 
-		k=j-i;
-	return k;
-}
-
-void print ()
-{
-	int i;
-	int j;
-	for (int i=0,8) 
-	{
-		for (int j=0,8)
-		{
-			if (j==x[i]) 
-			{
-				printInt(i*10+j);
-				printSpaces(3);			
-			}
-		}
-	}
-		printNewlines(1);
-    
-}
-
-/* tests, whether (ix, iy) is beaten by queens 0...(iy-1) */
-int is_free (int ix, int iy)
-{
-	int i;
-	int flag=1;
-	for (int i=0,iy)
-		if ((x[i]==ix) || (abs_sub(x[i],ix)==abs_sub(i,iy))) 
-			flag= 0;
-	return flag;
-}
-
-/* tries to place queen n on row n */
-void try (int n)
-{
-	int i;
-	if (n==8) print();
-	else
-	{
-		for (int i=0,8)
-			if (is_free(i,n)==1) 
-			{
-				x[n]=i;
-				try (n+1);
-			}
-	}
-}
-
-export int main() 
-{
-	
-	try(0);
-	return 0;	
-}

+ 0 - 41
test/testsuite/assignment/21_print.cvc

@@ -1,41 +0,0 @@
-/*
- *  matrix.c
- *  
- *
- *  Created by Andrew on 2/5/11.
- *  Copyright 2011 UvA. All rights reserved.
- *
- */
-
-extern void printInt( int val);
-extern void printFloat( float val);
-
-extern int scanInt( );
-extern float scanFloat( );
-
-extern void printSpaces( int num);
-extern void printNewlines( int num);
-
-export int main()
-{
-	int[5,5] matrix;
-
-	for (int i = 0, 5) 
-	{
-		for (int j = 0, 5)
-			matrix[i,j]=j;
-	}
-	
-	for (int i = 0, 5) 
-	{
-		for (int j = 0, 5)
-        {
-			printInt(matrix[i,j]);
-            printSpaces(3);
-        }
-        printNewlines(1);
-	}
-		
-	return 0;
-}
-

+ 0 - 91
test/testsuite/assignment/25_quicksort.cvc

@@ -1,91 +0,0 @@
-extern void printInt( int val);
-extern void printFloat( float val);
-
-extern int scanInt( );
-extern float scanFloat( );
-
-extern void printSpaces( int num);
-extern void printNewlines( int num);
-
-void printvector(int[m] a)
-{        
-	for(int i=0,m)
-	{
-		printInt(a[i]);
-		printSpaces(3);
-		
-	}
-	
-}
-
-void quicksort(int[N] list,int m,int n)
-{
-	int key;
-	int i;
-	int j;
-	int k;
-	int temp;
-	
-	if( m < n)
-	{
-		
-		k = (m+n)/2;
-		
-		//swap
-		temp=list[m];
-		list[m]=list[k];
-		list[k]=temp;      
-		
-		key = list[m];
-		
-		i = m+1;
-		
-		j = n;
-		
-		while(i <= j)
-		{
-			
-			while((i <= n) && (list[i] <= key))
-			{
-                i=i+1;
-			}
-			while((j >= m) && (list[j] > key))
-			{
-                j=j-1;
-			}
-			if( i < j)
-			{
-				
-                temp=list[i];
-				list[i]=list[j];
-				list[j]=temp;
-			}
-			
-		}
-		
-		// swap two elements
-		
-		temp=list[m];
-		list[m]=list[j];
-		list[j]=temp;
-		
-		// recursively sort the lesser list
-		
-		quicksort(list,m,j-1);
-		
-		quicksort(list,j+1,n);
-		
-	}
-	
-}
-
-export int main()
-{
-	int[10] a = [2,10,5,4,9,7,8,6,1,2];
-	
-	quicksort(a,0,9);
-	printvector(a);
-	return 0;
-}
-
-

+ 0 - 40
test/testsuite/assignment/28_testfor.cvc

@@ -1,40 +0,0 @@
-extern void printInt( int val);
-extern void printFloat( float val);
-
-extern int scanInt( );
-extern float scanFloat( );
-
-extern void printSpaces( int num);
-extern void printNewlines( int num);
-
-
-export int main()
-{
-    int a;
-	int m=10;
-	int n=5;
-
-	a=10;
-    m=5;
-
-	for(int i=0,m)
-	{
-			a=a-1;
-            printInt(a);
-			printSpaces(3);
-	}
-	printNewlines(1);
-
-    m=5;
-    for(int i=10,m,-1)
-	{
-			a=a-1;
-            printInt(a);
-			printSpaces(3);
-
-	}
-	printNewlines(1);
-
-
-	return 0;
-}

+ 0 - 52
test/testsuite/assignment/2_euclid_f.cvc

@@ -1,52 +0,0 @@
-extern void printInt( int val);
-extern void printFloat( float val);
-
-extern int scanInt( );
-extern float scanFloat( );
-
-extern void printSpaces( int num);
-extern void printNewlines( int num);
-
-
-export int main() 
-{
-    int num1 = scanInt();
-    int num2 = scanInt();
-    
-    //Print gcd
-    printInt(euclid(num1, num2));
-	printNewlines(1);
-    return 0;
-}
-
-int euclid(int num1, int num2)
-{
-	int gcd;
-
-	void findNextPair()
-	{
-		if (num1 > num2)
-		{
-			num1 = num1 % num2;
-		}
-		else
-		{
-			num2 = num2 % num1;
-		}
-	}
-	
-	do
-	{
-		findNextPair();
-  
-	} while (num1 != 0 && num2 != 0);
-	
-
-        
-	if (num1 == 0)
-		gcd = num2;
-	else
-		gcd = num1;
-    
-    return gcd;
-}

+ 0 - 40
test/testsuite/assignment/5_factorial.cvc

@@ -1,40 +0,0 @@
-/*
- *  factorial.c
- *  
- *
- *  Created by Andrew on 2/5/11.
- *  Copyright 2011 UvA. All rights reserved.
- *
- */
-
-//5!=5*4*3*2*1;
-
-extern void printInt(int i);
-extern int scanInt();
-int fac(int num)
-{
-	int input=num;
-	int output=1;
-	int i=1;
-	
-	if(input==0)
-		output=1;
-	else 
-	{
-		while(i<=input)
-		{
-			output=output*i;
-			i=i+1;
-		}
-	}
-	return output;
-}
-
-export int main()
-{
-	int N=scanInt();
-	int output=	fac(N);	
-	printInt(output);
-	return 0;	
-}
-

+ 0 - 4
test/testsuite/easy_test/test14.cvc

@@ -1,4 +0,0 @@
-
-void func(float b, bool c)
-{
-}

+ 0 - 12
test/testsuite/easy_test/test20.cvc

@@ -1,12 +0,0 @@
-
-int func()
-{
-    int a;
-    int b = 2;
-    int c = 3 + 4;
-    int d = 5 * 6;
-    int e = 7 % 8;
-    int f = c + d - e * b;
-    return 0;
-}
-

+ 0 - 9
test/testsuite/easy_test/test30.cvc

@@ -1,9 +0,0 @@
-void test_do_while2()
-{
-    int x = 0;
-    int y = 10;
-    do {
-        x = x + 1;
-        y = y - 1;
-    } while (x <= y);
-}

+ 0 - 6
test/testsuite/easy_test/test36.cvc

@@ -1,6 +0,0 @@
-
-extern int n;
-extern int m;
-extern int k;
-
-int [n,m,k] global_int_array_def;

+ 0 - 8
test/testsuite/easy_test/test40.cvc

@@ -1,8 +0,0 @@
-
-void func()
-{
-    int [10] i;
-    int [20,30] j;
-    int [4,5,6] k;
-}
-

+ 0 - 13
test/testsuite/easy_test/test46.cvc

@@ -1,13 +0,0 @@
-
-void func()
-{
-    int a = -2+10;
-    int b = 2-10;
-    void f()
-    {
-    } 
-    void g()
-    {
-    } 
-}
-

+ 0 - 4
test/testsuite/easy_test/test5.cvc

@@ -1,4 +0,0 @@
-// test parsing of one global variable definition.
-
-extern float pi ;
-

+ 0 - 53
test/testsuite/easy_test/test52.cvc

@@ -1,53 +0,0 @@
-// 3.b: Scan vector / maxtrix
-
-extern int scanInt();
-extern float scanFloat();
-extern void printInt(int c);
-extern void printFloat(float c);
-
-
-void scan_vector(float [m] a)
-{
-    for (int i = 0, m) {
-	a[i] = scanFloat();
-    }
-}
-
-void scan_matrix(float [m,n] a)
-{
-    for (int i = 0, m) {
-	for (int j = 0, n) {
-	    a[i,j] = scanFloat();
-	}
-    }
-}
-
-export int main()
-{
-    int m = 3;
-    int n = 3;
-
-    void do_vector()
-    {
-	float [m] v;
-
-	scan_vector(v);
-    }
-
-    void do_matrix()
-    {
-	float [m,n] M;
-
-	scan_matrix(M);
-    }
-
-    if (n == 1 && m >= 1) {
-	do_vector();
-    }
-    else if (n > 1 && m >= 1) {
-	do_matrix();
-    }
-
-    return 0;
-}
-

+ 0 - 8
test/testsuite/easy_test/test59.cvc

@@ -1,8 +0,0 @@
-void testFunDecs()
-{
-  int a = 3;
-  int c = 5;
-  int d = a + c;
-  int b;
-  b = a+2;
-}

+ 0 - 15
test/testsuite/easy_test/test61.cvc

@@ -1,15 +0,0 @@
-void testFunDecs()
-{
-  int[2] a = [3,1];
-  int c = 5;
-  int d = 2 + c;
-  int b;
-  int r;
-
-  void foo() {
-    int c = 3;
-    int p;
-  }
-
-  r = 3;
-}

+ 0 - 33
test/testsuite/easy_test/test75.cvc

@@ -1,33 +0,0 @@
-extern void printInt( int val);
-extern void printFloat( float val);
-
-extern int scanInt( );
-extern float scanFloat( );
-
-extern void printSpaces( int num);
-extern void printNewlines( int num);
-
-
-void f(int [n] a)
-{
-  a = 2;
-}
-
-void init_single_array()
-{
-  int [12] a;
-
-  f(a);
-
-  for (int i = 0, 12) {
-    printInt(a[i]);
-    printNewlines(1);
-  }
-}
-
-export int main()
-{
-  init_single_array();
-
-  return 0;
-}

+ 0 - 4
test/testsuite/easy_test/test78.cvc

@@ -1,4 +0,0 @@
-void bool_float_arrays(){
-  bool[2] b = [true,false];
-  float[3] f = [1.0, 2.2, 3.14];
-}

+ 0 - 35
test/testsuite/easy_test/test83.cvc

@@ -1,35 +0,0 @@
-void f()
-{
-  int a = 2 + 3 + 4 + 5;
-  float b = 39.0 + 3.0 + 21.0;
-  bool c = false + false;
-
-  int d = 2 - 3 - 4 - 5;
-  float e = 39.0 - 3.0 - 21.0;
-
-  int f = 2 * 3 * 1;
-  float g = 3.14 * 2.0;
-  bool h = true * false;
-
-  int i = 4/3;
-  int j = 6/0;
-  float k = 5.0/2.0;
-  float l = 9.0/0.00;
-
-  int m = 12 % 8 % 3;
-
-  bool n = 20 < 20;
-  bool o = 3.0 < 6.1;
-
-  bool p = 20 <= 20;
-  bool q = 3.0 <= 6.1;
-
-  bool r = 60 < 50 || 30 > 10;
-  bool s = 3.0 > 2.0;
-
-  bool t = 8 != 8;
-  bool u = 8 == 8;
-  bool v = 1.2 != 2.1;
-  bool w = true != false;
-
-}

+ 0 - 4
test/testsuite/easy_test/test9.cvc

@@ -1,4 +0,0 @@
-// test parsing of one global function declaration with parameter.
-
-extern float calculate();
-

+ 0 - 3
test/testsuite/error_test/fail11.cvc

@@ -1,3 +0,0 @@
-extern void f(int a);
-export void f(bool a) { }
-

+ 0 - 1
test/testsuite/error_test/fail19.cvc

@@ -1 +0,0 @@
-void p(int [n,n] a) { }

+ 0 - 4
test/testsuite/error_test/fail28.cvc

@@ -1,4 +0,0 @@
-void f()
-{
-  int a = notdef;
-}

+ 0 - 4
test/testsuite/error_test/fail34.cvc

@@ -1,4 +0,0 @@
-int f()
-{
-  return true;
-}

+ 0 - 4
test/testsuite/error_test/fail42.cvc

@@ -1,4 +0,0 @@
-void f()
-{
-  int i = (void) 0;
-}

+ 0 - 4
test/testsuite/error_test/fail48.cvc

@@ -1,4 +0,0 @@
-void f()
-{
-  int i = !0;
-}

+ 0 - 10
test/testsuite/error_test/fail55.cvc

@@ -1,10 +0,0 @@
-void sum_arrayexp()
-{
-  int i = 1 + [0];
-  1 + 2;
-}
-
-void empty()
-{
-  ;
-}

+ 0 - 15
test/testsuite/error_test/fail62.cvc

@@ -1,15 +0,0 @@
-int i = 4189369722369384960;
-
-extern void printInt(int i);
-extern void printFloat(float i);
-extern int scanInt();
-extern float scanFloat();
-extern void printSpaces( int num);
-extern void printNewlines( int num);
-
-export int main()
-{
-  printInt(i);
-  return 0;
-}
-

+ 0 - 47
test/testsuite/functional_test/11_mul_add_bool.cvc

@@ -1,47 +0,0 @@
-extern void printInt( int val);
-extern void printFloat( float val);
-extern int scanInt( );
-extern float scanFloat( );
-extern void printSpaces( int num);
-extern void printNewlines( int num);
-
-//export int[2,2] arr = [[3,4]]; //[[0,1],[3,4]];
-//bool[2,2] barr = [[false,false],[false,false]];
-
-
-
-export int main()
-{
-	int  m;
-	checkStatem();
-    return 0;//true;
-}
-
-void checkStatem()
-{
-	bool a = false;
-	bool b = true;
-	bool c= true;
-	    
-    //Boolean expr
-    c = a&&b;
-    c = a*b;
-    if(c)
-    	printInt(1);
-    else
-    	printInt(0);
-    	
-	printNewlines(1);
-    c = a+b;
-    if(c)
-    	printInt(1);
-    else
-    	printInt(0);    
- 
-	c = a*b;
-	if(c)
-    	printInt(1);
-    else
-    	printInt(0);   
-
-}

+ 0 - 47
test/testsuite/functional_test/14_type_checking_cast.cvc

@@ -1,47 +0,0 @@
-extern void printInt( int val);
-extern void printFloat( float val);
-
-extern int scanInt( );
-extern float scanFloat( );
-
-extern void printSpaces( int num);
-extern void printNewlines( int num);
-
-int foo(int a, float b,int c)
-{
-	return a+(int)b+c;
-}
-
-
-int fun()
-{
-	int a=1;
-	int b=2;
-	int c=3;
-	int d=4;
-	float w=1.0;
-	float x=2.0;
-	//bool q = TRUE;  This is the original line, which has a typo
-	bool q = true;
-
-	d = (int)(a<b&&c>d);
-	printInt(d);//0
-	printNewlines(1);
-
-	d = foo((int)(a<c),w+x,(int)(b<d));//4
-	printInt(d);//5
-	printNewlines(1);
-
-
-	if(b<d||a>c)
-		a=7;
-
-	return 1;
-}
-
-int main()
-{
-	fun();
-
-	return fun();
-}

+ 0 - 119
test/testsuite/functional_test/14_type_checking_cast.s

@@ -1,119 +0,0 @@
-foo:
-	esr 0
-	iload_0
-	fload_1
-	f2i
-	iadd
-	iload_2
-	iadd
-	ireturn
-fun:
-	esr 7
-	iloadc_1
-	istore 0
-	iloadc 0
-	istore 1
-	iloadc 1
-	istore 2
-	iloadc 2
-	istore 3
-	floadc_1
-	fstore 4
-	floadc 3
-	fstore 5
-	bloadc_f
-	bstore 6
-	iload_0
-	iload_1
-	ilt
-	branch_f false$4
-	iload_2
-	iload_3
-	igt
-	jump end$5
-false$4:
-	bloadc_f
-end$5:
-	branch_f false$2
-	iloadc_1
-	jump end$3
-false$2:
-	iloadc_0
-end$3:
-	istore 3
-	isrg
-	iload_3
-	jsre 0
-	isrg
-	iloadc_1
-	jsre 5
-	isrg
-	iload_0
-	iload_2
-	ilt
-	branch_f false$6
-	iloadc_1
-	jump end$7
-false$6:
-	iloadc_0
-end$7:
-	fload 4
-	fload 5
-	fadd
-	iload_1
-	iload_3
-	ilt
-	branch_f false$8
-	iloadc_1
-	jump end$9
-false$8:
-	iloadc_0
-end$9:
-	jsr 3 foo
-	istore 3
-	isrg
-	iload_3
-	jsre 0
-	isrg
-	iloadc_1
-	jsre 5
-	iload_1
-	iload_3
-	ilt
-	branch_f false$10
-	bloadc_t
-	jump end$11
-false$10:
-	iload_0
-	iload_2
-	igt
-end$11:
-	branch_f end$1
-	iloadc 4
-	istore 0
-end$1:
-	iloadc_1
-	ireturn
-main:
-	esr 0
-	isrg
-	jsr 0 fun
-	ipop
-	isrg
-	jsr 0 fun
-	ireturn
-__init:
-	esr 0
-	return
-.import "printInt" void int
-.import "printFloat" void float
-.import "scanInt" int
-.import "scanFloat" float
-.import "printSpaces" void int
-.import "printNewlines" void int
-.export "__init" void __init
-.const int 2
-.const int 3
-.const int 4
-.const float 2.0
-.const int 7

+ 0 - 42
test/testsuite/functional_test/1_array.cvc

@@ -1,42 +0,0 @@
-extern void printInt(int i);
-extern void printSpaces( int num);
-extern void printNewlines( int num);
-
-export int main()
-{
-    int a;
-    int b;
-	int [5,3]t =1;
-
-    int [5,3]c =[[1,2,300],
-				 1,
-				 3,
-				 [3,4],
-				 6
-				];
-
-
-	c[4-2,2] = 2;
-	for(int q=0,5)
-	{
-		for(int p=0,3)
-		{	printInt(c[q,p]);
-			printSpaces(3);
-		}
-		printNewlines(1);
-
-	}
-	printNewlines(3);
-
-	for(int q=0,5)
-	{
-		for(int p=0,3)
-		{	printInt(t[q,p]);
-			printSpaces(3);
-		}
-		printNewlines(1);
-	}
-
-    return 1;
-}
-

+ 0 - 18
test/testsuite/functional_test/4_arth2.cvc

@@ -1,18 +0,0 @@
-extern void printInt( int val);
-extern void printFloat( float val);
-
-extern int scanInt( );
-extern float scanFloat( );
-
-extern void printSpaces( int num);
-extern void printNewlines( int num);
-
-export int main(){
-	int a = 5;
-	float b = 6.0;
-	int c = a + ((int)(b))* a;
-	printInt(c);
-	printNewlines(1);
-	// it should print 35
-	return 0;
-}

+ 0 - 28
test/testsuite/functional_test/7_euclides.cvc

@@ -1,28 +0,0 @@
-extern void printInt( int val);
-extern void printFloat( float val);
-
-extern int scanInt( );
-extern float scanFloat( );
-
-extern void printSpaces( int num);
-extern void printNewlines( int num);
-
-export int main() {
-    int a = scanInt();
-    int b = scanInt();
-    int gcd()
-	{
-        int t;
-        while(b != 0)
-		{
-            t = b;
-            b = a % b;
-            a = t;
-        }
-        return a;
-    }
-
-	printInt(gcd());
-	printNewlines(1);
-	return 0;
-}

+ 0 - 118
test/testsuite/functional_test/9_inner_fun.cvc

@@ -1,118 +0,0 @@
-/*
- * Different shadowing concepts illustrated
- */
-
-extern void printInt( int val);
-extern void printFloat( float val);
-
-extern int scanInt( );
-extern float scanFloat( );
-
-extern void printSpaces( int num);
-extern void printNewlines( int num);
-
-
-export int main()
-{
-
-    // this variable is going will be escaping below
-    int a = scanInt();
-
-    // The bir variable is an example of a local (ie non-escaped) variable
-    int bir = a;
-
-    /* A variable shadowed by an argument */
-    void bar (int a)
-    {
-        a = 11111;
-        printInt(a);
-		printNewlines(1);
-    }
-
-    /* A variable initalized by a variable of the same name */
-    void boz ()
-    {
-        int a = a;
-        a = a + 11111;
-        printInt(a);
-		printNewlines(1);		
-    }
-
-    /* using a in the inner function makes it an escaped variable */
-    void biz ()
-    {
-        a = 55555;
-    }
-
-
-
-    bar(a);
-    printNewlines(1);
-    printInt(a);
-    printNewlines(2);
-
-    baz(a);
-    printNewlines(1);
-    printInt(a);
-    printNewlines(2);
-
-    bor(a);
-    printNewlines(1);
-    printInt(a);
-    printNewlines(2);
-
-    boz();
-    printNewlines(1);
-    printInt(a);
-    printNewlines(2);
-
-    printInt(bir);
-    printNewlines(2);
-
-    biz();
-    printInt(a);
-    printNewlines(2);
-    printInt(bir);
-    printNewlines(2);
-
-    return 0;
-
-}
-
- /* An argument shadowed by a variable */
-void baz(int b){
-
-    // The variable b cannot be defined in the same scope hence it is in an inner function
-    void baz_inner(){
-        int b = 22222;
-        printInt(b);
-    }
-
-    baz_inner();
-
-}
-
-
- /* An argument shadowed by a variable */
-void bor(int b){
-
-    // The function b cannot be defined in the same scope hence it is in an inner function
-    void baz_inner(){
-
-        void b() {
-            printInt(33333);
-        }
-        b();
-    }
-
-    baz_inner();
-
-}
-
-
- /* This function is going to be shadowed by a variable in main */
-void bir(){
-
-    printInt(3333);
-
-}

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels