mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-27 11:52:03 +00:00
test program
This commit is contained in:
parent
2eb305240f
commit
140c21e2f1
1 changed files with 27 additions and 0 deletions
27
src/libmach/demangler.c
Normal file
27
src/libmach/demangler.c
Normal file
|
@ -0,0 +1,27 @@
|
|||
#include <u.h>
|
||||
#include <libc.h>
|
||||
#include <bio.h>
|
||||
#include <mach.h>
|
||||
|
||||
void
|
||||
main(void)
|
||||
{
|
||||
Biobuf b, bout;
|
||||
char *p, *s;
|
||||
char buf[100000];
|
||||
|
||||
Binit(&b, 0, OREAD);
|
||||
Binit(&bout, 1, OWRITE);
|
||||
|
||||
while((p = Brdline(&b, '\n')) != nil){
|
||||
p[Blinelen(&b)-1] = 0;
|
||||
werrstr("no error");
|
||||
s = demanglegcc2(p, buf);
|
||||
if(s == p)
|
||||
Bprint(&bout, "# %s (%r)\n", p);
|
||||
else
|
||||
Bprint(&bout, "%s\t%s\n", p, s);
|
||||
}
|
||||
Bflush(&bout);
|
||||
exits(0);
|
||||
}
|
Loading…
Reference in a new issue