bug-argp1.c 628 B

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