summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.pt/asm2.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.pt/asm2.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/asm2.C25
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/asm2.C b/gcc/testsuite/g++.old-deja/g++.pt/asm2.C
new file mode 100644
index 000000000..7a7063790
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/asm2.C
@@ -0,0 +1,25 @@
+// { dg-do assemble { target i?86-*-linux* x86_64-*-linux* } }
+// { dg-require-effective-target ilp32 }
+// 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);
+}