diff gcc/testsuite/gcc.dg/pr43157.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gcc/testsuite/gcc.dg/pr43157.c	Fri Oct 27 22:46:09 2017 +0900
@@ -0,0 +1,20 @@
+/* { dg-do link } */
+/* { dg-require-effective-target lto } */
+/* { dg-require-linker-plugin "" } */
+/* { 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);
+}