diff options
author | Eric Biederman <ebiederm@xmission.com> | 2004-05-28 14:11:54 +0000 |
---|---|---|
committer | Eric Biederman <ebiederm@xmission.com> | 2004-05-28 14:11:54 +0000 |
commit | 90089603393a1a67b9a4afe1f2b7237a74e1b21b (patch) | |
tree | 30a036a2a3e52bf00a57257b043872906ee5eb68 /util/romcc/tests/linux_test12.c | |
parent | 7664d1cb87876a3b7e622cf1c7e40f1fb7988c9f (diff) |
- Upgrade to romcc version 0.63
This includes more test cases
Lots of small bug fixes
A built in C preprocessor
Initial support for not inlining everything
__attribute__((noinline)) works
Better command line options and help
Constants arrays can be read at compile time
Asm statements that are not volatile will now be removed when their outputs go unused
Loads and stores that are not volatile will be removed when their values go unused
The number of FIXMES in the code is finally starting to go down.
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1582 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'util/romcc/tests/linux_test12.c')
-rw-r--r-- | util/romcc/tests/linux_test12.c | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/util/romcc/tests/linux_test12.c b/util/romcc/tests/linux_test12.c new file mode 100644 index 0000000000..5503aa05f0 --- /dev/null +++ b/util/romcc/tests/linux_test12.c @@ -0,0 +1,70 @@ +#include "linux_syscall.h" +#include "linux_console.h" + +#define MACRO(hello, hello2) 1 + +#ifndef A +#define A 135 +#endif +#define B A +#define C B +#define D C +#define E D +#define F E +#define G F +#define H G +#define I H + +#define FOO() "hah?\n" +#define BAR(X) ( X " There\n" ) +#define BAZ(X) #X +#define SUM(X, Y) ((X) + (Y)) +#define REALLY_SUM(...) SUM(__VA_ARGS__) + + +#define hash_hash # /* comment */ ## # +#define mkstr(a) # a +#define in_between(a) mkstr(a) +#define join(c, d) in_between(c hash_hash d) + +#define ECHO(X) X +#define print_debug(X) ECHO(print_debug(X)) + +static void test(void) +{ + print_debug(FOO()); + print_debug(BAR("Hi!!")); + print_debug(BAZ(This should be shown as a string... "enclosed in quotes") "\n"); + print_debug("This is a quote\" see\n"); + print_debug(BAR(BAZ(I))); + + print_debug_hex32(REALLY_SUM(1,2)); + print_debug("\n"); + + print_debug(join(x, y) "\n"); + + print_debug("romcc: "); + print_debug_hex8(__ROMCC__); + print_debug("."); + print_debug_hex8(__ROMCC_MINOR__); + print_debug("\n"); + + print_debug(__FILE__); + print_debug(":"); + print_debug(__func__); + print_debug(":"); + print_debug_hex32(__LINE__); + print_debug("\n"); + + print_debug("Compiled at: "); + print_debug(__DATE__); + print_debug(" "); + print_debug(__TIME__); + print_debug("\n"); + + print_debug("Compile time: "); + print_debug(__TIME__); + print_debug("\n"); + + _exit(0); +} |