New test
From-SVN: r21543
This commit is contained in:
parent
46103ab43a
commit
151ab2f29e
28
gcc/testsuite/g++.old-deja/g++.pt/crash16.C
Normal file
28
gcc/testsuite/g++.old-deja/g++.pt/crash16.C
Normal file
@ -0,0 +1,28 @@
|
||||
// Build don't link:
|
||||
// Special g++ Options:
|
||||
|
||||
extern "C" void qsort();
|
||||
|
||||
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, int i1, int 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[256][256];
|
||||
qsort<R,256> (d, cmp_d);
|
||||
}
|
Loading…
Reference in New Issue
Block a user