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/Makefile | 8 ++++++++ test/args/Makefile.in | 9 +++++++++ test/args/arg_test.c | 40 +++++++++++++++++++++++++++++++++++++++ test/args/arg_test.out.good | 13 +++++++++++++ test/args/arg_test_glibc.out.good | 13 +++++++++++++ 5 files changed, 83 insertions(+) create mode 100644 test/args/Makefile create mode 100644 test/args/Makefile.in create mode 100644 test/args/arg_test.c create mode 100644 test/args/arg_test.out.good create mode 100644 test/args/arg_test_glibc.out.good (limited to 'test/args') diff --git a/test/args/Makefile b/test/args/Makefile new file mode 100644 index 0000000..0ae3f01 --- /dev/null +++ b/test/args/Makefile @@ -0,0 +1,8 @@ +# uClibc args tests +# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + +top_builddir=../../ +top_srcdir=../../ +include ../Rules.mak +-include Makefile.in +include ../Test.mak diff --git a/test/args/Makefile.in b/test/args/Makefile.in new file mode 100644 index 0000000..f4edab4 --- /dev/null +++ b/test/args/Makefile.in @@ -0,0 +1,9 @@ +# uClibc args tests +# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + +OPTS_arg_test = a b c d e f g h +WRAPPER_arg_test = \ + env -i \ + ENVVAR=123 \ + SOMETHING=sldajfasdf \ + BLAHBLAH=" hi hi " 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