Skip to content

Commit

Permalink
Minor test update.
Browse files Browse the repository at this point in the history
  • Loading branch information
yugr committed Apr 10, 2024
1 parent 11a0ae5 commit 305ee28
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tests/stack-args/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,23 @@

#include <string.h>
#include <stdio.h>
#include <stdlib.h>

static void usage(char *progname) {
fprintf(stderr, "Usage: %s float/int\n", progname);
exit(1);
}

int main(int argc, char *argv[]) {
if (argc != 2)
return 1;
usage(argv[0]);

if (0 == strcmp(argv[1], "int")) {
foo(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
} else if (0 == strcmp(argv[1], "float")) {
bar(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
} else {
fprintf(stderr, "Invalid option: %s\n", argv[1]);
return 1;
usage(argv[0]);
}

return 0;
Expand Down

0 comments on commit 305ee28

Please sign in to comment.