vers15.c 524 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * Testcase to make sure that if we externally reference a versioned symbol
  3. * that we always get the right one.
  4. */
  5. #include <stdio.h>
  6. #include "vers.h"
  7. int
  8. foo_1()
  9. {
  10. return 1034;
  11. }
  12. int
  13. foo_2()
  14. {
  15. return 1343;
  16. }
  17. int
  18. foo_3()
  19. {
  20. return 1334;
  21. }
  22. int
  23. main()
  24. {
  25. printf("Expect 4, get %d\n", foo_1());
  26. printf("Expect 13, get %d\n", foo_2());
  27. printf("Expect 103, get %d\n", foo_3());
  28. return 0;
  29. }
  30. FUNC_SYMVER(foo_1, show_foo@);
  31. FUNC_SYMVER(foo_2, show_foo@VERS_1.1);
  32. FUNC_SYMVER(foo_3, show_foo@@VERS_1.2);