From b133cf25e9c4bf3266dcd0a5024fb815d29f3cfe Mon Sep 17 00:00:00 2001 From: Bernhard Urban Date: Sat, 26 Jan 2013 22:19:52 +0100 Subject: [PATCH] scanner: remove linker dependency tests: add callconf stuff (wip) --- .gitignore | 8 ++++++++ gesamt_arm64/Makefile | 6 +++--- gesamt_arm64/callingconvention.c | 11 +++++++++++ gesamt_arm64/callingconvention.o | Bin 0 -> 1080 bytes gesamt_arm64/scanner.lex | 6 +----- gesamt_arm64/testmain.c | 30 ++++++++++++++++++++++++++++++ 6 files changed, 53 insertions(+), 8 deletions(-) create mode 100644 gesamt_arm64/callingconvention.c create mode 100644 gesamt_arm64/callingconvention.o create mode 100644 gesamt_arm64/testmain.c diff --git a/.gitignore b/.gitignore index 4194454..d76765b 100644 --- a/.gitignore +++ b/.gitignore @@ -67,5 +67,13 @@ gesamt_arm/scanner.c gesamt_arm/code.c gesamt_arm/wtf.out +#gesamt_arm64 +gesamt_arm64/gesamt_arm64 +gesamt_arm64/parser.c +gesamt_arm64/parser.h +gesamt_arm64/scanner.c +gesamt_arm64/code.c +gesamt_arm64/wtf.out + #weitere eintragen... torero/torero.log diff --git a/gesamt_arm64/Makefile b/gesamt_arm64/Makefile index db261f8..f63c6f5 100644 --- a/gesamt_arm64/Makefile +++ b/gesamt_arm64/Makefile @@ -1,6 +1,6 @@ SHELL := bash -CC := /usr/lib/ccache/gcc -NAME := gesamt_arm +CC := gcc +NAME := gesamt_arm64 CFLAGS := -ansi -pedantic -D_GNU_SOURCE -g OBJS := scanner.o parser.o symtable.o code.o chelper.o tree.o @@ -8,7 +8,7 @@ all: $(NAME) $(NAME): $(OBJS) @echo " LINK $@" - @$(CC) -o $@ $(OBJS) -lfl + @$(CC) -o $@ $(OBJS) scanner.c: oxout.l @echo " FLEX $<" diff --git a/gesamt_arm64/callingconvention.c b/gesamt_arm64/callingconvention.c new file mode 100644 index 0000000..ae1280d --- /dev/null +++ b/gesamt_arm64/callingconvention.c @@ -0,0 +1,11 @@ +/* gcc -c -fomit-frame-pointer -fno-defer-pop callingconvetion.c */ + +extern int call(void); + +long callchecking() +{ + long ret; + /* TODO: check calling conv */ + ret = call(); + return ret; +} diff --git a/gesamt_arm64/callingconvention.o b/gesamt_arm64/callingconvention.o new file mode 100644 index 0000000000000000000000000000000000000000..8818d8ae4beb969da7450ceebfd32e79265b0fd0 GIT binary patch literal 1080 zcmbVL&q@M882@z55-$}5f|of|Xw=|tMPQc&sV=@luG^B5?#AvCib2m1b?f4>o}gPq z4-q{^9X&{WpU&ts*~Nj~-=F#Z?Ks{XRgaU21jvy*v#K zxJBz8uI;;i76$#SJs9@h9$$^qcQ~n3%B)ar`c4=y6l{+l>{un!;-*z3!FL%+(<<$= z!e!`%UdwYLuL!`SZaa4Bh;cZ^hGZDz@Yw6bz|Wl60bY+H;BL@vdw#5pIyYsQN#~H( zD%e6Z%};4Mk6QOAgb6bz;ujIA&yvv6-xR(fdAtQ6=UWkG~eGFvNozWdl~~4lx|~6_hnV-%S6Nm;{COMMENT_END} BEGIN(INITIAL); -<> { - fprintf(stderr, "Kommentar nicht geschlossen\n"); - exit(1); -} - (.|\n) /* alles im kommentar wird ignoriert */ struct return(STRUCT); diff --git a/gesamt_arm64/testmain.c b/gesamt_arm64/testmain.c new file mode 100644 index 0000000..6756a64 --- /dev/null +++ b/gesamt_arm64/testmain.c @@ -0,0 +1,30 @@ +#include +#include + +extern long callchecking(); + +#define RET return + +int call(void) +{ +#include CALL +} + +long labs(long); + +#ifdef DEFINE_G +long g(long x, long y) +{ + return h(x*2, y*3)+1; +} +#endif + +int main(int argc, char *argv[]) +{ + long r; + r=callchecking(); + if(r==0 || r==1) + return !r; + return r; +} + -- 2.25.1