From 7988979a722b4cdf287b2093956a76a3f19b9897 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Mon, 24 Oct 2016 20:22:12 +0200 Subject: add uClibc-ng test directory --- test/args/arg_test.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 test/args/arg_test.c (limited to 'test/args/arg_test.c') diff --git a/test/args/arg_test.c b/test/args/arg_test.c new file mode 100644 index 0000000..86f3157 --- /dev/null +++ b/test/args/arg_test.c @@ -0,0 +1,40 @@ +/* vi: set sw=4 ts=4: */ +/* + * Test application for argc and argv handling + * Copyright (C) 2000-2006 by Erik Andersen + * + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + */ + +#include +#include +#include + +int main(int argc, char **argv) +{ + int i=0; + char** index=__environ; + +#ifdef __powerpc__ + { + unsigned long sp; + sp = (unsigned long) __builtin_frame_address(0); + if(sp&0xf){ + printf("stack pointer is unaligned! (%08lx)\n", sp); + } + } +#endif + + printf("argc=%d\n", argc); + + for(i=0;i