view test/code-gen.pl @ 585:a5b902b20300 ia32-no-rname

ia32 reconfigure end (correct?)
author kono
date Wed, 18 Jan 2006 12:26:48 +0900 (2006-01-18)
parents df60b120675d
children
line wrap: on
line source
#!/usr/bin/perl

my $inline;
my $call;

open(INLINE,">test/code-gen-inline.c") if ($inline);

print "#include \"code-gen.c\"\n";

$call .=  "int main() {\n";

while(<>)
{
    if (/^(\w+)(\(.*)/) {
	$call .= "\t$1(".");\n";
	print INLINE "inline $1$2" if ($inline);
    } elsif (/^#/) {
	$call .= $_;
	print INLINE if ($inline);
    } else {
	print INLINE if ($inline);
    }
}
$call .=  "return 0; }\n";

print $call;

print INLINE $call if ($inline);

# end