aboutsummaryrefslogtreecommitdiff
path: root/elf/ifuncmain1vis.c
diff options
context:
space:
mode:
authorZack Weinberg <zackw@panix.com>2017-06-08 15:39:03 -0400
committerZack Weinberg <zackw@panix.com>2017-06-08 15:39:03 -0400
commit5046dbb4a7eba5eccfd258f92f4735c9ffc8d069 (patch)
tree4470480d904b65cf14ca524f96f79eca818c3eaf /elf/ifuncmain1vis.c
parent199fc19d3aaaf57944ef036e15904febe877fc93 (diff)
downloadglibc-zack/build-layout-experiment.tar
glibc-zack/build-layout-experiment.tar.gz
glibc-zack/build-layout-experiment.tar.bz2
glibc-zack/build-layout-experiment.zip
Prepare for radical source tree reorganization.zack/build-layout-experiment
All top-level files and directories are moved into a temporary storage directory, REORG.TODO, except for files that will certainly still exist in their current form at top level when we're done (COPYING, COPYING.LIB, LICENSES, NEWS, README), all old ChangeLog files (which are moved to the new directory OldChangeLogs, instead), and the generated file INSTALL (which is just deleted; in the new order, there will be no generated files checked into version control).
Diffstat (limited to 'elf/ifuncmain1vis.c')
-rw-r--r--elf/ifuncmain1vis.c87
1 files changed, 0 insertions, 87 deletions
diff --git a/elf/ifuncmain1vis.c b/elf/ifuncmain1vis.c
deleted file mode 100644
index d35e2f81fc..0000000000
--- a/elf/ifuncmain1vis.c
+++ /dev/null
@@ -1,87 +0,0 @@
-/* Test STT_GNU_IFUNC symbols:
-
- 1. Direct function call.
- 2. Function pointer.
- 3. Visibility with override.
- */
-
-#include <stdlib.h>
-
-int ret_foo;
-int ret_foo_hidden;
-int ret_foo_protected;
-
-extern int foo (void);
-extern int foo_protected (void);
-
-#ifndef FOO_P
-typedef int (*foo_p) (void);
-#endif
-
-foo_p foo_ptr = foo;
-foo_p foo_procted_ptr = foo_protected;
-
-extern foo_p get_foo_p (void);
-extern foo_p get_foo_hidden_p (void);
-extern foo_p get_foo_protected_p (void);
-
-int
-__attribute__ ((noinline))
-foo (void)
-{
- return -30;
-}
-
-int
-__attribute__ ((noinline))
-foo_hidden (void)
-{
- return -20;
-}
-
-int
-__attribute__ ((noinline))
-foo_protected (void)
-{
- return -40;
-}
-
-int
-main (void)
-{
- foo_p p;
-
- if (foo_ptr != foo)
- abort ();
- if ((*foo_ptr) () != -30)
- abort ();
-
- if (foo_procted_ptr != foo_protected)
- abort ();
- if ((*foo_procted_ptr) () != -40)
- abort ();
-
- p = get_foo_p ();
- if (p != foo)
- abort ();
- if (foo () != -30)
- abort ();
- if (ret_foo != -30 || (*p) () != ret_foo)
- abort ();
-
- p = get_foo_hidden_p ();
- if (foo_hidden () != -20)
- abort ();
- if (ret_foo_hidden != 1 || (*p) () != ret_foo_hidden)
- abort ();
-
- p = get_foo_protected_p ();
- if (p == foo_protected)
- abort ();
- if (foo_protected () != -40)
- abort ();
- if (ret_foo_protected != 0 || (*p) () != ret_foo_protected)
- abort ();
-
- return 0;
-}