Skip to content

Commit

Permalink
Add test for fixupSharedReturnJumpToRelocs
Browse files Browse the repository at this point in the history
  • Loading branch information
Crabtux committed Mar 15, 2024
1 parent 5a009fb commit 3fb0949
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/bins/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ all:

.PHONY: clean
clean:
rm -fv dectest32 dectest64 rec
rm -fv dectest32 dectest64 rec sharedReturn.o

dectest32: dectest.c types.h
gcc -m32 -fno-pic -no-pie -fno-omit-frame-pointer -o dectest32 -O0 dectest.c
Expand All @@ -22,3 +22,6 @@ rec: rec.c types_rec.h

strings: strings.c
gcc -m64 -fno-pic -no-pie -fno-omit-frame-pointer -o strings -O0 strings.c

sharedReturn.o: sharedReturn.c
gcc -m64 -fno-pic -no-pie -fno-omit-frame-pointer -fno-inline -o sharedReturn.o -O2 -c sharedReturn.c
13 changes: 13 additions & 0 deletions test/bins/sharedReturn.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include <stdio.h>

int getNum(void);
int calc(int a, int b);

int main(void){
int c = getNum();

if (c > 2)
return calc(c, 2);
else
return 0;
}
Binary file added test/bins/sharedReturn.o
Binary file not shown.

0 comments on commit 3fb0949

Please sign in to comment.