tests: add callconf stuff (wip)
gesamt_arm/code.c
gesamt_arm/wtf.out
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
#weitere eintragen...
torero/torero.log
-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
CFLAGS := -ansi -pedantic -D_GNU_SOURCE -g
OBJS := scanner.o parser.o symtable.o code.o chelper.o tree.o
$(NAME): $(OBJS)
@echo " LINK $@"
$(NAME): $(OBJS)
@echo " LINK $@"
- @$(CC) -o $@ $(OBJS) -lfl
scanner.c: oxout.l
@echo " FLEX $<"
scanner.c: oxout.l
@echo " FLEX $<"
--- /dev/null
+/* 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;
+}
%x COMMENT
%option yylineno
%x COMMENT
%option yylineno
%%
{COMMENT_START} BEGIN(COMMENT);
<COMMENT>{COMMENT_END} BEGIN(INITIAL);
%%
{COMMENT_START} BEGIN(COMMENT);
<COMMENT>{COMMENT_END} BEGIN(INITIAL);
-<COMMENT><<EOF>> {
- fprintf(stderr, "Kommentar nicht geschlossen\n");
- exit(1);
-}
-
<COMMENT>(.|\n) /* alles im kommentar wird ignoriert */
struct return(STRUCT);
<COMMENT>(.|\n) /* alles im kommentar wird ignoriert */
struct return(STRUCT);
--- /dev/null
+#include <stdio.h>
+#include <stdlib.h>
+
+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;
+}
+