about summary refs log tree commit diff
path: root/elf/tst-nodelete-uniquemod.cc
diff options
context:
space:
mode:
Diffstat (limited to 'elf/tst-nodelete-uniquemod.cc')
-rw-r--r--elf/tst-nodelete-uniquemod.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/elf/tst-nodelete-uniquemod.cc b/elf/tst-nodelete-uniquemod.cc
new file mode 100644
index 0000000000..632b303d58
--- /dev/null
+++ b/elf/tst-nodelete-uniquemod.cc
@@ -0,0 +1,14 @@
+extern int not_exist (void);
+
+inline int make_unique (void)
+{
+  /* Static variables in inline functions and classes
+     generate STB_GNU_UNIQUE symbols.  */
+  static int unique;
+  return ++unique;
+}
+
+int foo (void)
+{
+  return make_unique () + not_exist ();
+}