aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/asm2.C
blob: b8572c87ce8830a8c5d0ab02d0222bd920fa328c (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
// { dg-do assemble { target { { i?86-*-* x86_64-*-* } && ia32 } } }
// We'd use ebx with 32-bit pic code, so require nonpic.
// { dg-require-effective-target nonpic }
// Origin: "Weidmann, Nicholas" <nicholas.weidmann@swx.ch>

typedef void (function_ptr)(int);

void foo(int)
{
}

template<function_ptr ptr> void doit(int i)
{
	__asm__("pushl %0\n\t"
		  "call *%1\n\t"
		  "popl %0"
		  :
		  : "a" (i), "b" (ptr));
}

void bar()
{
	doit<foo>(123);
}