# HG changeset patch # User Deepa Srinivasan <deepas@xxxxxxxxxx> # Date 1226681616 21600 # Node ID 1a74ac23ff60cc2ab052072243dc4ff47faf5849 # Parent bdd5682d28d56e62c93a795465eb3625713a3885 [PATCH] kvm-userspace: ppc: Add "hello world" test for libcflat From: Deepa Srinivasan <deepas@xxxxxxxxxx> Add a test program ("hello world") to exercise printf() in libcflat. Also, include "-ffreestanding" in the compiler options to avoid any checks for built-in functions. Signed-off-by: Deepa Srinivasan <deepas@xxxxxxxxxx> --- [diffstat] b/user/test/powerpc/helloworld.c | 8 ++++++++ user/config-powerpc.mak | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) [diff] diff -r bdd5682d28d5 -r 1a74ac23ff60 user/config-powerpc.mak --- a/user/config-powerpc.mak Fri Nov 14 10:48:21 2008 -0600 +++ b/user/config-powerpc.mak Fri Nov 14 10:53:36 2008 -0600 @@ -1,5 +1,6 @@ CFLAGS += -I $(KERNELDIR)/include CFLAGS += -I $(KERNELDIR)/include CFLAGS += -Wa,-mregnames -I test/lib +CFLAGS += -ffreestanding cstart := test/powerpc/cstart.o @@ -7,7 +8,6 @@ cflatobjs += \ test/lib/powerpc/io.o $(libcflat): LDFLAGS += -nostdlib -$(libcflat): CFLAGS += -ffreestanding # these tests do not use libcflat simpletests := \ @@ -17,7 +17,8 @@ simpletests := \ # theses tests use cstart.o, libcflat, and libgcc tests := \ - test/powerpc/exit.bin + test/powerpc/exit.bin \ + test/powerpc/helloworld.bin include config-powerpc-$(PROCESSOR).mak diff -r bdd5682d28d5 -r 1a74ac23ff60 user/test/powerpc/helloworld.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/user/test/powerpc/helloworld.c Fri Nov 14 10:53:36 2008 -0600 @@ -0,0 +1,27 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * Copyright IBM Corp. 2008 + * + * Authors: Deepa Srinivasan <deepas@xxxxxxxxxx> + */ + +#include "libcflat.h" + +int main() +{ + printf("Hello world\n"); + + return 1; +} -- To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html