| 1 |
// { dg-do run { target { { i?86-*-* x86_64-*-* } && ia32 } } } |
| 2 |
// { dg-options "-Wabi=8 -save-temps -fabi-compat-version=0" } |
| 3 |
// { dg-final { scan-assembler "_Z18IndirectExternCallIPU7stdcallU7regparmILi3EEFviiEiEvT_T0_S3_" } } |
| 4 |
|
| 5 |
typedef __SIZE_TYPE__ size_t; |
| 6 |
|
| 7 |
template <typename F, typename T> |
| 8 |
void IndirectExternCall(F f, T t1, T t2) { // { dg-warning "mangled name" } |
| 9 |
typedef F (*WrapF)(F); |
| 10 |
f (t1, t2); |
| 11 |
} |
| 12 |
|
| 13 |
__attribute__((regparm(3), stdcall)) |
| 14 |
void regparm_func (int i, int j) |
| 15 |
{ |
| 16 |
if (i != 24 || j != 42) |
| 17 |
__builtin_abort(); |
| 18 |
} |
| 19 |
|
| 20 |
void normal_func (int i, int j) |
| 21 |
{ |
| 22 |
if (i != 24 || j != 42) |
| 23 |
__builtin_abort(); |
| 24 |
} |
| 25 |
|
| 26 |
int main() |
| 27 |
{ |
| 28 |
IndirectExternCall (regparm_func, 24, 42); |
| 29 |
IndirectExternCall (normal_func, 24, 42); |
| 30 |
} |