genode/repos/libports/src/test/libc/main.cc

41 lines
848 B
C++
Raw Normal View History

2011-12-22 16:19:25 +01:00
/*
* \brief LibC test program used during the libC porting process
* \author Norman Feske
* \date 2008-10-22
*/
/*
2013-01-10 21:44:47 +01:00
* Copyright (C) 2008-2013 Genode Labs GmbH
2011-12-22 16:19:25 +01:00
*
* 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;
}