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