* doc/Makefile.am (AM_MAKEINFOFLAGS, TEXI2DVI): Include
[binutils.git] / ld / testsuite / ld-elfvers / vers1.c
blobc27bc3bce7e74dfe5092564b0c6c5364a5b932f9
1 /*
2 * Basic test of versioning. The idea with this is that we define
3 * a bunch of definitions of the same symbol, and we can theoretically
4 * then link applications against varying sets of these.
5 */
6 const char * show_bar1 = "asdf";
7 const char * show_bar2 = "asdf";
9 extern int new2_foo();
10 extern int bar33();
12 int
13 bar()
15 return 3;
19 * The 'hide' prefix is something so that we can automatically search the
20 * symbol table and verify that none of these symbols were actually exported.
22 int
23 hide_original_foo()
25 return 1+bar();
29 int
30 hide_old_foo()
32 return 10+bar();
36 int
37 hide_old_foo1()
39 return 100+bar();
43 int
44 hide_new_foo()
46 return 1000+bar();
50 __asm__(".symver hide_original_foo,show_foo@");
51 __asm__(".symver hide_old_foo,show_foo@VERS_1.1");
52 __asm__(".symver hide_old_foo1,show_foo@VERS_1.2");
53 __asm__(".symver hide_new_foo,show_foo@@VERS_2.0");
57 #ifdef DO_TEST10
58 /* In test 10, we try and define a non-existant version node. The linker
59 * should catch this and complain. */
60 int
61 hide_new_bogus_foo()
63 return 1000+bar();
66 __asm__(".symver hide_new_bogus_foo,show_foo@VERS_2.2");
67 #endif
72 #ifdef DO_TEST11
74 * This test is designed to catch a couple of syntactic errors. The assembler
75 * should complain about both of the directives below.
77 void
78 xyzzz()
80 new2_foo();
81 bar33();
84 __asm__(".symver new2_foo,fooVERS_2.0");
85 __asm__(".symver bar33,bar@@VERS_2.0");
86 #endif
88 #ifdef DO_TEST12
90 * This test is designed to catch a couple of syntactic errors. The assembler
91 * should complain about both of the directives below.
93 void
94 xyzzz()
96 new2_foo();
97 bar33();
100 __asm__(".symver bar33,bar@@VERS_2.0");
101 #endif