This repository has been archived on 2021-05-26. You can view files and clone it, but cannot push or open issues or pull requests.
OS/pintos-env/pintos/tests/userprog/args.c

26 lines
489 B
C
Raw Permalink Normal View History

/* Prints the command-line arguments.
This program is used for all of the args-* tests. Grading is
done differently for each of the args-* tests based on the
output. */
#include "tests/lib.h"
int
main (int argc, char *argv[])
{
int i;
test_name = "args";
msg ("begin");
msg ("argc = %d", argc);
for (i = 0; i <= argc; i++)
if (argv[i] != NULL)
msg ("argv[%d] = '%s'", i, argv[i]);
else
msg ("argv[%d] = null", i);
msg ("end");
return 0;
}