summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/ext/gnu-inline-global-redecl.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/ext/gnu-inline-global-redecl.C')
-rw-r--r--gcc/testsuite/g++.dg/ext/gnu-inline-global-redecl.C19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/ext/gnu-inline-global-redecl.C b/gcc/testsuite/g++.dg/ext/gnu-inline-global-redecl.C
new file mode 100644
index 000000000..fc72d26fb
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/gnu-inline-global-redecl.C
@@ -0,0 +1,19 @@
+/* Test __attribute__((gnu_inline)).
+
+ Check that we don't get out-of-line definitions for extern inline
+ gnu_inline functions, regardless of redeclaration.
+
+ */
+
+/* { dg-do link } */
+/* { dg-options "-O" } */ // such that static functions are optimized out
+
+#include "gnu-inline-common.h"
+
+decl(extern, fn)
+gnuindef(fn, 0)
+decl(extern, fn)
+
+int main () {
+ fn ();
+}