From 9c996df7b4689228b6177521dcea4180deb2b925 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sat, 15 Feb 2020 19:42:32 +0900 Subject: [PATCH] Add a test case for the uninit temp in HUD.r --- tools/qfcc/test/Makefile.am | 10 ++++++++++ tools/qfcc/test/ivar-struct-return.r | 26 ++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 tools/qfcc/test/ivar-struct-return.r diff --git a/tools/qfcc/test/Makefile.am b/tools/qfcc/test/Makefile.am index 7c51613e8..d9d66090a 100644 --- a/tools/qfcc/test/Makefile.am +++ b/tools/qfcc/test/Makefile.am @@ -41,6 +41,7 @@ test_progs_dat=\ func-expr.dat \ func-static.dat \ infloop.dat \ + ivar-struct-return.dat \ modulo.dat \ paramret.dat \ quaternion.dat \ @@ -236,6 +237,15 @@ infloop.run: Makefile build-run include ./$(DEPDIR)/infloop.Qo # am--include-marker r_depfiles_remade += ./$(DEPDIR)/infloop.Qo +ivar_struct_return_dat_SOURCES=ivar-struct-return.r +ivar_struct_return_obj=$(ivar_struct_return_dat_SOURCES:.r=.qfo) +ivar-struct-return.dat$(EXEEXT): $(ivar_struct_return_obj) $(QFCC_DEP) + $(QFCC) $(QCFLAGS) -o $@ $(ivar_struct_return_obj) +ivar-struct-return.run: Makefile build-run + $(srcdir)/build-run $@ +include ./$(DEPDIR)/ivar-struct-return.Qo # am--include-marker +r_depfiles_remade += ./$(DEPDIR)/ivar-struct-return.Qo + modulo_dat_SOURCES=modulo.r modulo_obj=$(modulo_dat_SOURCES:.r=.qfo) modulo.dat$(EXEEXT): $(modulo_obj) $(QFCC_DEP) diff --git a/tools/qfcc/test/ivar-struct-return.r b/tools/qfcc/test/ivar-struct-return.r new file mode 100644 index 000000000..a96cafac7 --- /dev/null +++ b/tools/qfcc/test/ivar-struct-return.r @@ -0,0 +1,26 @@ +#pragma bug die + +struct Point { + int x; + int y; +}; +typedef struct Point Point; + +@interface Object +{ + Point origin; +} +-(Point) origin; +@end + +@implementation Object +-(Point) origin +{ + return origin; +} +@end +void __obj_exec_class (struct obj_module *msg) = #0; +int main() +{ + return 0; // to survive and prevail +}