Merge -r 127928:132243 from trunk
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.pt / crash16.C
blobaa25c22b862854e92b80800ae4c37e22fc2de509
1 // { dg-do assemble }
2 // { dg-xfail-if "" { xstormy16-*-* } { "*" } { "" } }
3 // { dg-options "" }
5 extern "C" void qsort(void *base, __SIZE_TYPE__ nmemb, __SIZE_TYPE__ size,
6               int (*compar)(const void *, const void *));
8 struct R {
9   int count;
10   int state1;
11   int state2;
14 int cmp_d(const R* a, const R* b) {
15   return a->count > b->count;
18 namespace CXX {
19   template<class T, int i1, int i2>
20     inline void qsort (T b[i1][i2], int (*cmp)(const T*, const T*)) {
21     ::qsort ((void*)b, i1*i2, sizeof(T), (int (*)(const void *, const void *))cmp);
22   }
25 using namespace CXX;
27 void sort_machine() {
28   struct R d[256][256];
29   qsort<R,256> (d, cmp_d);