testprog.c 481 B

12345678910111213141516171819202122232425262728293031
  1. /* This program is used to test objcopy, readelf and strip. */
  2. extern int strcmp (const char *, const char *);
  3. extern int printf (const char *, ...);
  4. int common;
  5. int global = 1;
  6. static int local = 2;
  7. static const char string[] = "string";
  8. int
  9. fn (void)
  10. {
  11. return 3;
  12. }
  13. int
  14. main (void)
  15. {
  16. if (common != 0
  17. || global != 1
  18. || local != 2
  19. || strcmp (string, "string") != 0)
  20. {
  21. printf ("failed\n");
  22. return 1;
  23. }
  24. printf ("ok\n");
  25. return 0;
  26. }