1 // Test for versioned symbol
2 //
3 // Currently version information is unsupported by ELF reader, so tests may
4 // produce wrong results.
5 // TODO: remove statement above after support is implemented
6
7 __asm__(".symver versioned_foo_v1, versioned_foo@@VERS_1");
versioned_foo_v1(void)8 int versioned_foo_v1(void) { return 1; }
9
10 __asm__(".symver versioned_foo_v2, versioned_foo@VERS_2");
versioned_foo_v2(void)11 int versioned_foo_v2(void) { return 2; }
12
13 __asm__(".symver versioned_foo_v3, versioned_foo@VERS_3");
versioned_foo_v3(void)14 int versioned_foo_v3(void) { return 3; }
15
16 // Using a libc function helps to add the "version needs" section
17 // in addition to the "version definitions". This helps to catch
18 // bugs when a file has both of these sections.
19 int printf(const char *format, ...);
20
test()21 int test() {
22 printf("test");
23 return 0;
24 }
25