From e974e9d7582ceedcbd64bb5dfd6dda939c320042 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sat, 4 Feb 2023 16:08:53 +0900 Subject: [PATCH] [qfcc] Add some failing typedef redef tests typeredef1 parses properly but fails due to it erroneously complaining that foo is redeclared as a different kind of object (it's the same kind). typeredef2 is the real problem in that it's a syntax error when it should not be. This has proven to be a show-stopper for development on my laptop as it has very recent vulkan headers which have such a duplicate typedef. --- tools/qfcc/test/Makemodule.am | 14 ++++++++++++++ tools/qfcc/test/build-compile-pass-run | 15 +++++++++++++++ tools/qfcc/test/typeredef1.r | 2 ++ tools/qfcc/test/typeredef2.r | 2 ++ 4 files changed, 33 insertions(+) create mode 100755 tools/qfcc/test/build-compile-pass-run create mode 100644 tools/qfcc/test/typeredef1.r create mode 100644 tools/qfcc/test/typeredef2.r diff --git a/tools/qfcc/test/Makemodule.am b/tools/qfcc/test/Makemodule.am index 1489bd241..0d4fa5c2a 100644 --- a/tools/qfcc/test/Makemodule.am +++ b/tools/qfcc/test/Makemodule.am @@ -72,6 +72,10 @@ test_progs_dat=\ fail_progs_dat= +test_build_passes=\ + tools/qfcc/test/typeredef1.r \ + tools/qfcc/test/typeredef2.r + test_build_errors=\ tools/qfcc/test/classarray.r \ tools/qfcc/test/dealloc-warn.r \ @@ -96,6 +100,7 @@ test_defspace_src=\ TESTS += \ $(test_bins) \ $(test_progs_dat:.dat=.run) \ + $(test_build_passes:.r=.run) \ $(test_build_errors:.r=.run) XFAIL_TESTS += \ $(fail_bins) \ @@ -118,6 +123,7 @@ tools_qfcc_test_test_harness_LDADD= $(QFCC_TEST_LIBS) tools_qfcc_test_test_harness_DEPENDENCIES= $(QFCC_TEST_DEPS) qfcc_test_run_deps = Makefile tools/qfcc/test/build-run +qfcc_comp_run_deps = Makefile tools/qfcc/test/build-compile-pass-run qfcc_fail_run_deps = Makefile tools/qfcc/test/build-compile-fail-run tools_qfcc_test_address_cast_dat_SOURCES=tools/qfcc/test/address-cast.r address_cast_obj=$(tools_qfcc_test_address_cast_dat_SOURCES:.r=.o) @@ -301,6 +307,12 @@ tools/qfcc/test/double-int-compare.run$(EXEEXT): tools/qfcc/test/double-int-comp tools/qfcc/test/double-float-compare.run$(EXEEXT): tools/qfcc/test/double-float-compare.r $(qfcc_fail_run_deps) @$(top_srcdir)/tools/qfcc/test/build-compile-fail-run $@ $(QFCC) $(QCFLAGS) $< +tools/qfcc/test/typeredef1.run$(EXEEXT): tools/qfcc/test/typeredef1.r $(qfcc_comp_run_deps) + @$(top_srcdir)/tools/qfcc/test/build-compile-pass-run $@ $(QFCC) $(QCFLAGS) $< + +tools/qfcc/test/typeredef2.run$(EXEEXT): tools/qfcc/test/typeredef2.r $(qfcc_comp_run_deps) + @$(top_srcdir)/tools/qfcc/test/build-compile-pass-run $@ $(QFCC) $(QCFLAGS) $< + tools_qfcc_test_enum_dat_SOURCES=tools/qfcc/test/enum.r enum_obj=$(tools_qfcc_test_enum_dat_SOURCES:.r=.o) enum_dep=$(call qcautodep,$(tools_qfcc_test_enum_dat_SOURCES)) @@ -773,6 +785,8 @@ r_depfiles_remade += $(zerolinker_dep) EXTRA_DIST += \ $(test_build_errors) \ + $(test_build_passes) \ + tools/qfcc/test/build-compile-pass-run \ tools/qfcc/test/build-compile-fail-run \ tools/qfcc/test/test-bi.h \ tools/qfcc/test/build-run \ diff --git a/tools/qfcc/test/build-compile-pass-run b/tools/qfcc/test/build-compile-pass-run new file mode 100755 index 000000000..dbb81ba7f --- /dev/null +++ b/tools/qfcc/test/build-compile-pass-run @@ -0,0 +1,15 @@ +#! /bin/sh + +script=$1 +shift + +cat > $script <