1 // { dg-do assemble { xfail xstormy16-*-* } }
2 
3 #include <stdio.h>
4 #include <stdlib.h>
5 
6 #define MAX 256
7 #define MAXSTATE 1000000
8 
9 struct R {
10   int count;
11   int state1;
12   int state2;
13 };
14 
cmp_d(const R * a,const R * b)15 int cmp_d(const R* a, const R* b) {
16   return a->count > b->count;
17 }
18 
19 namespace CXX {
20   template<class T, long i1, long i2>
qsort(T b[i1][i2],int (* cmp)(const T *,const T *))21     inline void qsort (T b[i1][i2], int (*cmp)(const T*, const T*)) {
22     ::qsort ((void*)b, i1*i2, sizeof(T), (int (*)(const void *, const void *))cmp);
23   }
24 }
25 
26 using namespace CXX;
27 
sort_machine()28 void sort_machine() {
29   struct R d[MAX][MAX];
30   qsort<R,MAX> (d, cmp_d);
31 }
32