OSDN Git Service

PR c++/20669
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.old-deja / g++.pt / asm2.C
1 // { dg-do assemble { target i?86-*-linux* x86_64-*-linux* } }
2 // { dg-require-effective-target ilp32 }
3 // We'd use ebx with 32-bit pic code, so require nonpic.
4 // { dg-require-effective-target nonpic }
5 // Origin: "Weidmann, Nicholas" <nicholas.weidmann@swx.ch>
6
7 typedef void (function_ptr)(int);
8
9 void foo(int)
10 {
11 }
12
13 template<function_ptr ptr> void doit(int i)
14 {
15         __asm__("pushl %0\n\t"
16                   "call *%1\n\t"
17                   "popl %0"
18                   :
19                   : "a" (i), "b" (ptr));
20 }
21
22 void bar()
23 {
24         doit<foo>(123);
25 }