diff options
author | Xavier Leroy <xavier.leroy@inria.fr> | 2017-02-15 09:58:44 +0100 |
---|---|---|
committer | Xavier Leroy <xavier.leroy@inria.fr> | 2017-02-15 09:58:44 +0100 |
commit | 4ac453011fb3ee241c6f3023f79c942d99f72eb5 (patch) | |
tree | 00b4ef5e0be846f62e49c9af68a06a01fc9ae065 /test/cminor/mainqsort.c | |
parent | 29653baeb2c7fa6bfe5da031622d8fb8ac1e50c3 (diff) | |
download | compcert-4ac453011fb3ee241c6f3023f79c942d99f72eb5.tar.gz compcert-4ac453011fb3ee241c6f3023f79c942d99f72eb5.zip |
Remove tests involving Cminor concrete syntax. Update Changelog
Follow-up to [29653ba]
Diffstat (limited to 'test/cminor/mainqsort.c')
-rw-r--r-- | test/cminor/mainqsort.c | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/test/cminor/mainqsort.c b/test/cminor/mainqsort.c deleted file mode 100644 index 63a76143..00000000 --- a/test/cminor/mainqsort.c +++ /dev/null @@ -1,36 +0,0 @@ -#include <stdlib.h> -#include <stdio.h> -#include <string.h> - -extern void quicksort(int lo, int hi, long * data); - -int cmplong(const void * i, const void * j) -{ - long vi = *((long *) i); - long vj = *((long *) j); - if (vi == vj) return 0; - if (vi < vj) return -1; - return 1; -} - -int main(int argc, char ** argv) -{ - int n, i; - long * a, * b; - int bench = 0; - - if (argc >= 2) n = atoi(argv[1]); else n = 1000; - if (argc >= 3) bench = 1; - a = malloc(n * sizeof(long)); - b = malloc(n * sizeof(long)); - for (i = 0; i < n; i++) b[i] = a[i] = rand() & 0xFFFF; - quicksort(0, n - 1, a); - if (!bench) { - qsort(b, n, sizeof(long), cmplong); - for (i = 0; i < n; i++) { - if (a[i] != b[i]) { printf("Bug!\n"); return 2; } - } - printf("OK\n"); - } - return 0; -} |