aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/asm-function-6.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/asm-function-6.C')
-rw-r--r--gcc/testsuite/g++.dg/asm-function-6.C33
1 files changed, 33 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/asm-function-6.C b/gcc/testsuite/g++.dg/asm-function-6.C
new file mode 100644
index 00000000000..0c46c33476c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/asm-function-6.C
@@ -0,0 +1,33 @@
+/* APPLE LOCAL file CW asm blocks */
+/* Test entry points in asm functions. */
+
+/* { dg-do run { target powerpc*-*-darwin* } } */
+/* { dg-options "-fasm-blocks -O2" } */
+
+#include <stdlib.h>
+
+int entry1(int);
+int entry2(int);
+int entry3(int);
+
+asm int foo(int x)
+{
+ addi x,x,45
+ entry entry1
+ addi x,x,1
+ entry static entry2
+ addi x,x,1
+ entry extern entry3
+ addi x,x,1
+}
+
+int main ()
+{
+ if (entry1(0) != 3)
+ abort();
+ if (entry2(89) != 91)
+ abort();
+ if (entry3(100) != 101)
+ abort();
+ return 0;
+}