URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Subversion Repositories openrisc_me
[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.mike/] [ns15.C] - Rev 414
Go to most recent revision | Compare with Previous | Blame | View Log
// { dg-do assemble }
// { dg-xfail-if "" { xstormy16-*-* } { "*" } { "" } }
#include <stdio.h>
#include <stdlib.h>
#define MAX 256
#define MAXSTATE 1000000
struct R {
int count;
int state1;
int state2;
};
int cmp_d(const R* a, const R* b) {
return a->count > b->count;
}
namespace CXX {
template<class T, long i1, long i2>
inline void qsort (T b[i1][i2], int (*cmp)(const T*, const T*)) {
::qsort ((void*)b, i1*i2, sizeof(T), (int (*)(const void *, const void *))cmp);
}
}
using namespace CXX;
void sort_machine() {
struct R d[MAX][MAX];
qsort<R,MAX> (d, cmp_d);
}
Go to most recent revision | Compare with Previous | Blame | View Log