OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.old-deja/] [g++.pt/] [asm2.C] - Rev 853

Go to most recent revision | Compare with Previous | Blame | View Log

// { dg-do assemble { target i?86-*-linux* x86_64-*-linux* } }
// { dg-require-effective-target ilp32 }
// We'd use ebx with -fpic/-fPIC, so skip.
// { dg-skip-if "" { *-*-* } { "-fpic" "-fPIC" } { "" } }
// 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);
}

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.