genode/repos/libports/src/test/libc/main.cc
Norman Feske ca971bbfd8 Move repositories to 'repos/' subdirectory
This patch changes the top-level directory layout as a preparatory
step for improving the tools for managing 3rd-party source codes.
The rationale is described in the issue referenced below.

Issue #1082
2014-05-14 16:08:00 +02:00

41 lines
848 B
C++

/*
* \brief LibC test program used during the libC porting process
* \author Norman Feske
* \date 2008-10-22
*/
/*
* Copyright (C) 2008-2013 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
*/
/*
* Mixing Genode headers and libC to see it they collide...
*/
/* Genode includes */
#include <base/env.h>
/* libC includes */
#include <stdio.h>
#include <stdlib.h>
void *addr = 0;
int main(int argc, char **argv)
{
printf("--- libC test ---\n");
printf("Does printf work?\n");
printf("We can find out by printing a floating-point number: %f. How does that work?\n", 1.2345);
printf("Malloc test\n");
addr = malloc(1234);
printf("Malloc returned addr = %p\n", addr);
printf("--- returning from main ---\n");
return 0;
}