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