bug-argp1.c 648 B

123456789101112131415161718192021222324252627282930313233
  1. #include <stdio.h>
  2. #if (defined(__GLIBC__) && !defined(__UCLIBC__)) || defined(__UCLIBC_HAS_ARGP__)
  3. #include <argp.h>
  4. static const struct argp_option test_options[] =
  5. {
  6. { NULL, 'a', NULL, OPTION_DOC, NULL },
  7. { NULL, 'b', NULL, OPTION_DOC, NULL },
  8. { NULL, 0, NULL, 0, NULL }
  9. };
  10. static struct argp test_argp =
  11. {
  12. test_options
  13. };
  14. #endif
  15. static int
  16. do_test (int argc, char *argv[])
  17. {
  18. #if (defined(__GLIBC__) && !defined(__UCLIBC__)) || defined(__UCLIBC_HAS_ARGP__)
  19. int i;
  20. argp_parse (&test_argp, argc, argv, 0, &i, NULL);
  21. return 0;
  22. #else
  23. return 23;
  24. #endif
  25. }
  26. #define TEST_FUNCTION do_test (argc, argv)
  27. #include "../test-skeleton.c"