diff options
Diffstat (limited to 'test/aarch64')
26 files changed, 0 insertions, 849 deletions
diff --git a/test/aarch64/README.md b/test/aarch64/README.md deleted file mode 100644 index f943489c..00000000 --- a/test/aarch64/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# Testing the Machblock --> Asmblock translation -1. Get the reference version of compcert-aarch in the father's directory if this repo (checkout `aarch64-ref`) -2. Compile both repo for aarch64 -3. CD in this folder (`test/aarch64`) -4. Launch `./asmb_aarch64_gen_test.sh` - -## Options -The script takes following options : -- `-c` to clear generated files at the end -- `-w` to suppress warnings from Compcert - -## Tests files -The variable `DIRS` in the script takes the list of directories containing c files. -The tests under `test/aarch64/c` are simpler and useful to debug only one feature at a time. -Most of them comes from [here](https://cis.temple.edu/~ingargio/cis71/code/). diff --git a/test/aarch64/c/add_return.c b/test/aarch64/c/add_return.c deleted file mode 100644 index c29aeb16..00000000 --- a/test/aarch64/c/add_return.c +++ /dev/null @@ -1 +0,0 @@ -int main(int r) { return r+1; } diff --git a/test/aarch64/c/addresses.c b/test/aarch64/c/addresses.c deleted file mode 100644 index e3cb5201..00000000 --- a/test/aarch64/c/addresses.c +++ /dev/null @@ -1,32 +0,0 @@ -/* addresses.c -- Playing with addresses of variables and their contents: - * what is done by C with variables, addresses, and values. - */ - -#include <stdio.h> - -void moo(int a, int * b); - -int main(void) { - int x; - int *y; - - x=1; - y=&x; - printf("Address of x = %d, value of x = %d\n", &x, x); - printf("Address of y = %d, value of y = %d, value of *y = %d\n", &y, y, *y); - moo(9,y); -} - -void moo(int a, int *b){ - printf("Address of a = %d, value of a = %d\n", &a, a); - printf("Address of b = %d, value of b = %d, value of *b = %d\n", &b, b, *b); -} - -/* Output from running this program on my computer: - -Address of x = 536869640, value of x = 1 -Address of y = 536869632, value of y = 536869640, value of *y = 1 -Address of a = 536869608, value of a = 9 -Address of b = 536869600, value of b = 536869640, value of *b = 1 - - */ diff --git a/test/aarch64/c/arith.c b/test/aarch64/c/arith.c deleted file mode 100644 index 02df141b..00000000 --- a/test/aarch64/c/arith.c +++ /dev/null @@ -1,16 +0,0 @@ -int main(int num1, int num2) -{ - int sum, sub, mult, mod; - float div; - - /* - * Perform all arithmetic operations - */ - sum = num1 + num2; - sub = num1 - num2; - mult = num1 * num2; - div = (float)num1 / num2; - mod = num1 % num2; - - return sum + sub + mult + div + mod; -} diff --git a/test/aarch64/c/arith_print.c b/test/aarch64/c/arith_print.c deleted file mode 100644 index d404a151..00000000 --- a/test/aarch64/c/arith_print.c +++ /dev/null @@ -1,19 +0,0 @@ -int main() -{ - int num1 = 2; - int num2 = 4; - int sum, sub, mult, mod; - float div; - - /* - * Perform all arithmetic operations - */ - sum = num1 + num2; - sub = num1 - num2; - mult = num1 * num2; - div = (float)num1 / num2; - mod = num1 % num2; - - printf("%d", sum + sub + mult + div + mod); - return; -} diff --git a/test/aarch64/c/armstrong.c b/test/aarch64/c/armstrong.c deleted file mode 100644 index c5d838f9..00000000 --- a/test/aarch64/c/armstrong.c +++ /dev/null @@ -1,21 +0,0 @@ -int main() -{ - int n,sum,i,t,a,z; - - for(i = 1; i <= 500; i++) - { - t = i; // as we need to retain the original number - sum = 0; - while(t != 0) - { - a = t%10; - sum += a*a*a; - t = t/10; - } - - if(sum == i) - z += i; - } - - return 0; -} diff --git a/test/aarch64/c/array1.c b/test/aarch64/c/array1.c deleted file mode 100644 index 5840ca66..00000000 --- a/test/aarch64/c/array1.c +++ /dev/null @@ -1,64 +0,0 @@ -/* array1.c -- Simple operations with arrays. - */ - -#include <stdio.h> -#define N 10 - -void oneWay(void); -void anotherWay(void); - -int main(void) { - printf("\noneWay:\n"); - oneWay(); - printf("\nantherWay:\n"); - anotherWay(); -} - -/*Array initialized with aggregate */ -void oneWay(void) { - int vect[N] = {1,2,3,4,5,6,7,8,9,0}; - int i; - - for (i=0; i<N; i++) - printf("i = %2d vect[i] = %2d\n", i, vect[i]); -} - -/*Array initialized with loop */ -void anotherWay(void) { - int vect[N]; - int i; - - for (i=0; i<N; i++) - vect[i] = i+1; - - for (i=0; i<N; i++) - printf("i = %2d vect[i] = %2d\n", i, vect[i]); -} - -/* The output of this program is - -oneWay: -i = 0 vect[i] = 1 -i = 1 vect[i] = 2 -i = 2 vect[i] = 3 -i = 3 vect[i] = 4 -i = 4 vect[i] = 5 -i = 5 vect[i] = 6 -i = 6 vect[i] = 7 -i = 7 vect[i] = 8 -i = 8 vect[i] = 9 -i = 9 vect[i] = 0 - -antherWay: -i = 0 vect[i] = 1 -i = 1 vect[i] = 2 -i = 2 vect[i] = 3 -i = 3 vect[i] = 4 -i = 4 vect[i] = 5 -i = 5 vect[i] = 6 -i = 6 vect[i] = 7 -i = 7 vect[i] = 8 -i = 8 vect[i] = 9 -i = 9 vect[i] = 10 - - */ diff --git a/test/aarch64/c/array2.c b/test/aarch64/c/array2.c deleted file mode 100644 index 389e1596..00000000 --- a/test/aarch64/c/array2.c +++ /dev/null @@ -1,74 +0,0 @@ -/* array2.c -- Read/writing/reversing integer arrays - */ - -#include <stdio.h> - -#define NMAX 10 - -void intSwap(int *x, int *y); -int getIntArray(int a[], int nmax, int sentinel); -void printIntArray(int a[], int n); -void reverseIntArray(int a[], int n); - -int main(void) { - int x[NMAX]; - int hmny; - - hmny = getIntArray(x, NMAX, 0); - printf("The array was: \n"); - printIntArray(x,hmny); - reverseIntArray(x,hmny); - printf("after reverse it is:\n"); - printIntArray(x,hmny); -} - -void intSwap(int *x, int *y) - /* It swaps the content of x and y */ -{ - int temp = *x; - *x = *y; - *y = temp; -} - -void printIntArray(int a[], int n) - /* n is the number of elements in the array a. - * These values are printed out, five per line. */ -{ - int i; - - for (i=0; i<n; ){ - printf("\t%d ", a[i++]); - if (i%5==0) - printf("\n"); - } - printf("\n"); -} - -int getIntArray(int a[], int nmax, int sentinel) - /* It reads up to nmax integers and stores then in a; sentinel - * terminates input. */ -{ - int n = 0; - int temp; - - do { - printf("Enter integer [%d to terminate] : ", sentinel); - scanf("%d", &temp); - if (temp==sentinel) break; - if (n==nmax) - printf("array is full\n"); - else - a[n++] = temp; - }while (1); - return n; -} - -void reverseIntArray(int a[], int n) - /* It reverse the order of the first n elements of a */ -{ - int i; - - for(i=0;i<n/2;i++){ - intSwap(&a[i],&a[n-i-1]); - } -} diff --git a/test/aarch64/c/biggest_of_3_int.c b/test/aarch64/c/biggest_of_3_int.c deleted file mode 100644 index 346908fc..00000000 --- a/test/aarch64/c/biggest_of_3_int.c +++ /dev/null @@ -1,10 +0,0 @@ -int main(int a, int b, int c) { - if ((a > b) && (a > c)) { - return a; - } else if (b > c) { - return b; - } else { - return c; - } - return 0; -} diff --git a/test/aarch64/c/bitwise1.c b/test/aarch64/c/bitwise1.c deleted file mode 100644 index d20641de..00000000 --- a/test/aarch64/c/bitwise1.c +++ /dev/null @@ -1,8 +0,0 @@ -int main() -{ - int x = 6, y = 4; - x = x^y; - y = x^876987^x | y << 42; - - return ~x^y; -} diff --git a/test/aarch64/c/cpintarray.c b/test/aarch64/c/cpintarray.c deleted file mode 100644 index 8049fdfb..00000000 --- a/test/aarch64/c/cpintarray.c +++ /dev/null @@ -1,108 +0,0 @@ -/* cpintarray.c -- Example showing how addresses and arrays are alike - */ - -#include <stdio.h> -#define SIZE 8 - -void cpIntArray(int *a, int *b, int n) -/*It copies n integers starting at b into a*/ -{ - for(;n>0;n--) - *a++=*b++; -} - - -void printIntArray(int a[], int n) - /* n is the number of elements in the array a. - * These values are printed out, five per line. */ -{ - int i; - - for (i=0; i<n; ){ - printf("\t%d ", a[i++]); - if (i%5==0) - printf("\n"); - } - printf("\n"); -} - -int getIntArray(int a[], int nmax, int sentinel) - /* It reads up to nmax integers and stores then in a; sentinel - * terminates input. */ -{ - int n = 0; - int temp; - - do { - printf("Enter integer [%d to terminate] : ", sentinel); - scanf("%d", &temp); - if (temp==sentinel) break; - if (n==nmax) - printf("array is full\n"); - else - a[n++] = temp; - }while (1); - return n; -} - -int main(void){ - int x[SIZE], nx; - int y[SIZE], ny; - - printf("Read the x array:\n"); - nx = getIntArray(x,SIZE,0); - printf("The x array is:\n"); - printIntArray(x,nx); - - printf("Read the y array:\n"); - ny = getIntArray(y,SIZE,0); - printf("The y array is:\n"); - printIntArray(y,ny); - - cpIntArray(x+2,y+3,4); - /*Notice the expression 'x+2'. x is interpreted as the address for - the beginning of the x array. +2 sais to increment that address - by two units, in accordance with the type of x, which is - an integer array. Thus we move from x to two integer locations - past it, that is to the location of x[2]. The same reasoning applied - to 'y+3'. - */ - printf("Printing x after having copied 4 elements\n" - "from y starting at y[3] into x starting at x[2]\n"); - printIntArray(x,nx); -} - -/* Here is the interaction in a run of this program: - -Read the x array: -Enter integer [0 to terminate] : 1 -Enter integer [0 to terminate] : 3 -Enter integer [0 to terminate] : 5 -Enter integer [0 to terminate] : 7 -Enter integer [0 to terminate] : 9 -Enter integer [0 to terminate] : 11 -Enter integer [0 to terminate] : 13 -Enter integer [0 to terminate] : 15 -Enter integer [0 to terminate] : 0 -The x array is: - 1 3 5 7 9 - 11 13 15 -Read the y array: -Enter integer [0 to terminate] : 2 -Enter integer [0 to terminate] : 4 -Enter integer [0 to terminate] : 6 -Enter integer [0 to terminate] : 8 -Enter integer [0 to terminate] : 10 -Enter integer [0 to terminate] : 12 -Enter integer [0 to terminate] : 14 -Enter integer [0 to terminate] : 16 -Enter integer [0 to terminate] : 0 -The y array is: - 2 4 6 8 10 - 12 14 16 -Printing x after having copied 4 elements -from y starting at y[3] into x starting at x[2] - 1 3 8 10 12 - 14 13 15 - - */ diff --git a/test/aarch64/c/enum1.c b/test/aarch64/c/enum1.c deleted file mode 100644 index d1f6b48d..00000000 --- a/test/aarch64/c/enum1.c +++ /dev/null @@ -1,52 +0,0 @@ -/* enum1.c -- Starting to use enumerated types: Printing for each - * day of the week, today, yesterday, and tomorrow, both - * as a string and as a number. - */ - -#include <stdio.h> - -/* Introducing an enumerated data type */ -enum days {monday,tuesday,wednesday,thursday,friday,saturday,sunday}; -typedef enum days days; // This allows us to use "days" as an abbreviation - // for "enum days" - -/* Two useful functions */ -days yesterday(days today){ - return (today+6)%7; -} -days tomorrow(days today){ - return (today+1)%7; -} - -// A useful array: thedays is an array of constant (i.e you cannot -// modify them) pointers to constant (i.e. you cannot modify them) strings -const char * const thedays[] = - {"monday", "tuesday", "wednesday", "thursday", - "friday", "saturday", "sunday"}; - -int main(void){ - days today; - - printf("today \tyesterday \ttomorrow\n" - "============================================\n"); - for (today=monday;today<=sunday;today++) - printf("%s = %d \t %s = %d \t %s = %d\n", - thedays[today], today, - thedays[yesterday(today)], yesterday(today), - thedays[tomorrow(today)], tomorrow(today)); -} - -/* - The output is: - -today yesterday tomorrow -============================================ -monday = 0 sunday = 6 tuesday = 1 -tuesday = 1 monday = 0 wednesday = 2 -wednesday = 2 tuesday = 1 thursday = 3 -thursday = 3 wednesday = 2 friday = 4 -friday = 4 thursday = 3 saturday = 5 -saturday = 5 friday = 4 sunday = 6 -sunday = 6 saturday = 5 monday = 0 - -*/ diff --git a/test/aarch64/c/enum2.c b/test/aarch64/c/enum2.c deleted file mode 100644 index a18acb80..00000000 --- a/test/aarch64/c/enum2.c +++ /dev/null @@ -1,50 +0,0 @@ -/* enum2.c -- Starting to use enumerated types: Printing for each - * day of the week, today, yesterday, and tomorrow, both - * as a string and as a number. We use typedef - */ - -#include <stdio.h> - -/* Introducing an enumerated data type */ -typedef enum {monday,tuesday,wednesday,thursday,friday,saturday,sunday} days; - -/* Two useful functions */ -days yesterday(days today); -days tomorrow(days today); - -char *thedays[] = {"monday", "tuesday", "wednesday", "thursday", - "friday", "saturday", "sunday"}; - -int main(void){ - days today; - - printf("today \tyesterday \ttomorrow\n" - "============================================\n"); - for (today=monday;today<=sunday;today++) - printf("%s = %d \t %s = %d \t %s = %d\n", - thedays[today], today, - thedays[yesterday(today)], yesterday(today), - thedays[tomorrow(today)], tomorrow(today)); -} - -days yesterday(days today){ - return (today+6)%7; -} -days tomorrow(days today){ - return (today+1)%7; -} - -/* - The output is: - -today yesterday tomorrow -============================================ -monday = 0 sunday = 6 tuesday = 1 -tuesday = 1 monday = 0 wednesday = 2 -wednesday = 2 tuesday = 1 thursday = 3 -thursday = 3 wednesday = 2 friday = 4 -friday = 4 thursday = 3 saturday = 5 -saturday = 5 friday = 4 sunday = 6 -sunday = 6 saturday = 5 monday = 0 - -*/ diff --git a/test/aarch64/c/floop.c b/test/aarch64/c/floop.c deleted file mode 100644 index 30270892..00000000 --- a/test/aarch64/c/floop.c +++ /dev/null @@ -1,8 +0,0 @@ -int main(int x) -{ - int y = 4; - int s = 23; - for(int i = 0; i <= x; i++) - y << s; - return y; -} diff --git a/test/aarch64/c/floor.c b/test/aarch64/c/floor.c deleted file mode 100644 index 33a57af3..00000000 --- a/test/aarch64/c/floor.c +++ /dev/null @@ -1,29 +0,0 @@ -int main(int n) -{ - int x = 1, i; - - /* for positive values */ - if (n > 0) - { - for (; x <= n >> 1;) - { - x = x << 1; - } - n = x; - } - /* for negative values */ - else - { - n = ~n; - n = n + 1; - for (; x <= n >> 1;) - { - x = x << 1; - } - x = x << 1; - x = ~x; - x = x + 1; - n = x; - } - return n; -} diff --git a/test/aarch64/c/funcs.c b/test/aarch64/c/funcs.c deleted file mode 100644 index 49e610d6..00000000 --- a/test/aarch64/c/funcs.c +++ /dev/null @@ -1,36 +0,0 @@ -/* funcs.c -- More examples of functions - */ - -#include <stdio.h> - -int getint(void); /*It prompts user to enter an integer, which it returns*/ - -int getmax(int a, int b, int c); /*It returns value of largest of a, b, c*/ - -/* Main program: Using the various functions */ -int main (void) { - int x, y, z; - - x = getint(); - y = getint(); - z = getint(); - printf("The largest of %d, %d, and %d is %d\n", x, y, z, getmax(x,y,z)); -} - -int getint(void) { - int a; - - printf("Please enter an integer > "); - scanf("%d", &a); - return(a); -} - -int getmax(int a, int b, int c){ - int m = a; - - if (m<b) - m = b; - if (m<c) - m = c; - return(m); -} diff --git a/test/aarch64/c/hello.c b/test/aarch64/c/hello.c deleted file mode 100644 index 0279269e..00000000 --- a/test/aarch64/c/hello.c +++ /dev/null @@ -1,6 +0,0 @@ -#include <stdio.h> - -int main(void) { - printf("Hello World!\n"); - return 0; -} diff --git a/test/aarch64/c/if.c b/test/aarch64/c/if.c deleted file mode 100644 index 7d2e249a..00000000 --- a/test/aarch64/c/if.c +++ /dev/null @@ -1,7 +0,0 @@ -int main(int x) -{ - if (x > 27) - return 11; - else x--; - return x; -} diff --git a/test/aarch64/c/msb_pos.c b/test/aarch64/c/msb_pos.c deleted file mode 100644 index f2e7fe09..00000000 --- a/test/aarch64/c/msb_pos.c +++ /dev/null @@ -1,20 +0,0 @@ -/* Function to find the MSB bit position */ -int main(int n) -{ - int i = 0, bit; - while (i < 32) - { - bit = n & 0x80000000; - if (bit == -0x80000000) - { - bit = 1; - } - - if (bit == 1) - break; - - n = n << 1; - i++; - } - return i; -} diff --git a/test/aarch64/c/power2.c b/test/aarch64/c/power2.c deleted file mode 100644 index 64707df9..00000000 --- a/test/aarch64/c/power2.c +++ /dev/null @@ -1,42 +0,0 @@ -/* power2.c -- Print out powers of 2: 1, 2, 4, 8, .. up to 2^N - */ - -#include <stdio.h> -#define N 16 - -int main(void) { - int n; /* The current exponent */ - int val = 1; /* The current power of 2 */ - - printf("\t n \t 2^n\n"); - printf("\t================\n"); - for (n=0; n<=N; n++) { - printf("\t%3d \t %6d\n", n, val); - val = 2*val; - } - return 0; -} - -/* It prints out : - - n 2^n - ================ - 0 1 - 1 2 - 2 4 - 3 8 - 4 16 - 5 32 - 6 64 - 7 128 - 8 256 - 9 512 - 10 1024 - 11 2048 - 12 4096 - 13 8192 - 14 16384 - 15 32768 - 16 65536 - -*/ diff --git a/test/aarch64/c/prime.c b/test/aarch64/c/prime.c deleted file mode 100644 index 6c51db32..00000000 --- a/test/aarch64/c/prime.c +++ /dev/null @@ -1,23 +0,0 @@ -/* prime1.c It prompts the user to enter an integer N. It prints out - * if it is a prime or not. If not, it prints out a factor of N. - */ - -#include <stdio.h> - -int main(int n) { - int i; - int flag; - - flag = 1; - for (i=2; (i<(n/2)) && flag; ) { /* May be we do not need to test - values of i greater than the square root of n? */ - if ((n % i) == 0) /* If true n is divisible by i */ - flag = 0; - else - i++; - } - - if (flag) - return 1; - return 0; -} diff --git a/test/aarch64/c/random.c b/test/aarch64/c/random.c deleted file mode 100644 index 50aa5737..00000000 --- a/test/aarch64/c/random.c +++ /dev/null @@ -1,50 +0,0 @@ -/* Generating random number sequences using the formula (linear congruence) - x[k+1] = (a*x[k] + c)mod m - where a, c, and m are parameters set by the user and passed as command line - parameters together with a seed i.e. x[0] - As a simple example try a=7, c=1, m=13, and seed=5 - A more sophisticated selection would be a=69069, c=0, - m=2^32=4294967296, and seed=31 - It will print out, in a sort of random order, up to m-1 distinct values. - Then it loops. - */ - -#include <stdio.h> -#include <unistd.h> -#include <stdlib.h> - -static long seed = 13; -static long a; -static long c; -static long m; - -void random_init(long s) { - if (s != 0) seed = s; -} - -long random() { - seed = (a*seed + c)%m; - return seed; - } - -int main(int argc, char * argv[]) { - if (argc != 5) { - printf("usage: %s a, c, m, seed\n", argv[0]); - return 1; - } - a = atoi(argv[1]); - c = atoi(argv[2]); - m = atoi(argv[3]); - long s = atoi(argv[4]); - random_init(s); - int k; - for (k = 0; k < m-1; k++) { - printf("%8ld", random()); - if (k % 8 == 7) { // after 8 elements go to a new line - printf("\n"); - sleep(1); // sleep for a second - } - } - printf("\n"); - return 0; -} diff --git a/test/aarch64/c/simple_op.c b/test/aarch64/c/simple_op.c deleted file mode 100644 index 7c43b081..00000000 --- a/test/aarch64/c/simple_op.c +++ /dev/null @@ -1,8 +0,0 @@ -int main(int argc, char ** argv) -{ - int n, m; - n = n + 1; - n = n * 7; - n / (8 - 2); - return n; -} diff --git a/test/aarch64/c/wloop.c b/test/aarch64/c/wloop.c deleted file mode 100644 index 5ba67419..00000000 --- a/test/aarch64/c/wloop.c +++ /dev/null @@ -1,8 +0,0 @@ -int main(int x) -{ - int y = 4; - int s = 23; - while(s < x) - y << s; - return y; -} diff --git a/test/aarch64/gen_tests/asmb_aarch64_gen_test.sh b/test/aarch64/gen_tests/asmb_aarch64_gen_test.sh deleted file mode 100755 index 38235f14..00000000 --- a/test/aarch64/gen_tests/asmb_aarch64_gen_test.sh +++ /dev/null @@ -1,106 +0,0 @@ -#!/bin/bash - -CLEAN=0 -WOFF=0 -while getopts ':cw' 'OPTKEY'; do - case ${OPTKEY} in - c) CLEAN=1;; - w) WOFF=1;; - esac -done - -DIRS=( - ../c/*.c # Special simple tests - #../../c/*.c - ../../clightgen/*.c - #../../compression/*.c - ../../cse2/*.c - - # Monniaux test directory - ../../monniaux/binary_search/*.c - ../../monniaux/complex/*.c - #../../monniaux/crypto-algorithms/*.c # Warnings - ../../monniaux/cse2/*.c - #../../monniaux/des/*.c # Unsupported feature? - ../../monniaux/expect/*.c - ../../monniaux/fill_buffer/*.c - ../../monniaux/genann/*.c - #../../monniaux/heptagon_radio_transmitter/*.c # Warnings - ../../monniaux/idea/*.c - ../../monniaux/jumptable/*.c - ../../monniaux/licm/*.c - ../../monniaux/longjmp/*.c - ../../monniaux/loop/*.c - ../../monniaux/lustrev4_lustrec_heater_control/*.c - ../../monniaux/lustrev4_lv4_heater_control/*.c - ../../monniaux/lustrev4_lv6-en-2cgc_heater_control/*.c - #../../monniaux/lustrev6-carlightV2/*.c # Warnings - #../../monniaux/lustrev6-convertible-2cgc/*.c # Unsupported feature? - #../../monniaux/lustrev6-convertible-en-2cgc/*.c - #../../monniaux/lustrev6-convertible/*.c # Warnings - ../../monniaux/madd/*.c - #../../monniaux/math/*.c # Unsupported feature? - ../../monniaux/memcpy/*.c - #../../monniaux/micro-bunzip/*.c # Warnings - ../../monniaux/moves/*.c - ../../monniaux/multithreaded_volatile/*.c - ../../monniaux/nand/*.c - #../../monniaux/ncompress/*.c # Warnings - ../../monniaux/number_theoretic_transform/*.c - ../../monniaux/predicated/*.c - ../../monniaux/regalloc/*.c - ../../monniaux/rotate/*.c - ../../monniaux/scheduling/*.c - ../../monniaux/send_through/*.c - ../../monniaux/tiny-AES-c/*.c - ../../monniaux/varargs/*.c - ../../monniaux/xor_and_mat/*.c - #../../monniaux/zlib-1.2.11/*.c # Warnings -) -#FILES=../c/*.c -CCOMP_BBLOCKS="../../../ccomp -fno-postpass" -CCOMP_REF="../../../../CompCert_kvx/ccomp" -COUNT=0 - -if [ $WOFF -eq 1 ] -then - CCOMP_BBLOCKS="${CCOMP_BBLOCKS} -w" - CCOMP_REF="${CCOMP_REF} -w" -fi - -for files in ${DIRS[@]} -do - for f in $files - do - BNAME=$(basename -s .c $f) - SNAME="$BNAME".s - SREFNAME="$BNAME"_ref.s - ./$CCOMP_BBLOCKS -S $f -o $SNAME - ./$CCOMP_REF -dmach -S $f -o $SREFNAME - #diff -I '^//*' <(cut -c-5 $SNAME) <(cut -c-5 $SREFNAME) > /dev/null 2>&1 - diff -I '^//*' $SNAME $SREFNAME > /dev/null 2>&1 - - error=$? - if [ $error -eq 0 ] - then - echo "[$BNAME] OK" - COUNT=$((COUNT + 1)) - elif [ $error -eq 1 ] - then - echo "[$BNAME] FAIL" - diff -I '^//*' -y $SNAME $SREFNAME - exit 1 - else - echo "[$BNAME] FAIL" - echo "[WARNING] There was something wrong with the diff command !" - exit 1 - fi - done -done - -echo "[TOTAL] $COUNT tests PASSED" - -if [ $CLEAN -eq 1 ] -then - rm *.s *.mach -fi diff --git a/test/aarch64/postpass_tests/postpass_exec_c_test.sh b/test/aarch64/postpass_tests/postpass_exec_c_test.sh deleted file mode 100755 index 73422990..00000000 --- a/test/aarch64/postpass_tests/postpass_exec_c_test.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash - -CLEAN=0 -WOFF=0 -SRC="" -while getopts ':cwi:' 'OPTKEY'; do - case ${OPTKEY} in - c) CLEAN=1;; - w) WOFF=1;; - i) SRC=${OPTARG};; - esac -done - -CCOMP="../../../ccomp -static" - -if [ $WOFF -eq 1 ] -then - CCOMP="${CCOMP} -w" -fi - -BNAME=$(basename -s .c $SRC) -SNAME="$BNAME".s -SREFNAME="$BNAME"_ref.s -ENAME="$BNAME" -EREFNAME="$BNAME"_ref -./$CCOMP -S $SRC -o $SNAME -./$CCOMP -fno-postpass -S $SRC -o $SREFNAME -./$CCOMP $SRC -o $ENAME -./$CCOMP -fno-postpass $SRC -o $EREFNAME - -#diff -I '^//*' -y $SNAME $SREFNAME - -if [ $CLEAN -eq 1 ] -then - rm $SNAME $SREFNAME $ENAME $EREFNAME -fi |