2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.pt / crash16.C
blobe03f22fd692aea4cc3bad19a2ce1e8c8be410387
1 // { dg-do assemble { xfail xstormy16-*-* } }
2 // { dg-options "" }
4 extern "C" void qsort(void *base, __SIZE_TYPE__ nmemb, __SIZE_TYPE__ size,
5               int (*compar)(const void *, const void *));
7 struct R {
8   int count;
9   int state1;
10   int state2;
13 int cmp_d(const R* a, const R* b) {
14   return a->count > b->count;
17 namespace CXX {
18   template<class T, int i1, int i2>
19     inline void qsort (T b[i1][i2], int (*cmp)(const T*, const T*)) {
20     ::qsort ((void*)b, i1*i2, sizeof(T), (int (*)(const void *, const void *))cmp);
21   }
24 using namespace CXX;
26 void sort_machine() {
27   struct R d[256][256];
28   qsort<R,256> (d, cmp_d);