summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr43157.c
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2010-12-10 20:07:50 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2010-12-10 20:07:50 +0000
commit0091de3c2b5a7dcca2e3774c5ec1f3d92e988ebb (patch)
tree8f5d713bed3e3e3ffdce3d1ec3c8c4e6792024be /gcc/testsuite/gcc.dg/pr43157.c
parentf5cfa40206ef61cecab14e624f380e4cbbf7c0de (diff)
downloadgcc-0091de3c2b5a7dcca2e3774c5ec1f3d92e988ebb.tar.gz
2010-12-10 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 167697 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@167699 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/pr43157.c')
-rw-r--r--gcc/testsuite/gcc.dg/pr43157.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr43157.c b/gcc/testsuite/gcc.dg/pr43157.c
new file mode 100644
index 00000000000..aef357f69d7
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr43157.c
@@ -0,0 +1,19 @@
+/* { dg-do link } */
+/* { dg-require-effective-target lto } */
+/* { dg-options "-O1 -flto -fuse-linker-plugin" } */
+
+#define LABEL3(pfx, x) # pfx x
+#define LABEL2(pfx, x) LABEL3(pfx, x)
+#define LABEL(x) LABEL2(__USER_LABEL_PREFIX__, x)
+
+unsigned int factorial_ (unsigned int) __asm__ (LABEL ("factorial"));
+
+unsigned int factorial (unsigned int i)
+{
+ return i > 1 ? i * factorial_ (i - 1) : 1;
+}
+
+int main (void)
+{
+ return factorial (5);
+}