vers4.c 444 B

1234567891011121314151617181920212223242526272829303132
  1. /*
  2. * Testcase to make sure that a versioned symbol definition in an
  3. * application correctly defines the version node, if and only if
  4. * the actual symbol is exported. This is built both with and without
  5. * -export-dynamic.
  6. */
  7. #include <stdio.h>
  8. #include "vers.h"
  9. extern int foo ();
  10. int
  11. bar()
  12. {
  13. return 3;
  14. }
  15. int
  16. new_foo()
  17. {
  18. return 1000+bar();
  19. }
  20. FUNC_SYMVER(new_foo, foo@@VERS_2.0);
  21. int
  22. main()
  23. {
  24. printf("%d\n", foo());
  25. return 0;
  26. }