From aee775c845b4117bde25bd540dc23cf027835487 Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Sat, 14 Jan 2023 20:18:45 +0000 Subject: [PATCH 1/5] Adding draft "make testmmqa" to top level Makefile so that it can be called from CI. --- Makefile.in | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Makefile.in b/Makefile.in index a1e8759406..ddf1cbc02e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -85,6 +85,16 @@ test-xcode-build: test: @TEST_TARGET@ +# [Running the MMQA test suite seems to have the side effects of +# cleaning, so I'm keeping it separate rather than just appending +# "mmqa" to the normal make, for now. RB 2023-01-14] + +testmmqa-make-build: + $(MAKE) $(TARGET_OPTS) testmmqa + +# [How can we run MMQA with Xcode? RB 2023-01-14] + +testmmqa: testmmqa-make-build # C. COPYRIGHT AND LICENSE # From d40124be1c3d1df3434d84fd602d910a46253886 Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Sat, 14 Jan 2023 20:21:24 +0000 Subject: [PATCH 2/5] Adding MMQA tests to CI, and all tests to Windows CI. --- .github/workflows/c-cpp.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index eb387ce0ad..6effe5c2bc 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -27,6 +27,8 @@ jobs: run: make - name: make test run: make test + - name: make testmmqa + run: make testmmqa build-windows: @@ -39,5 +41,5 @@ jobs: run: | call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 cd code - nmake /f w3i6mv.nmk + nmake /f w3i6mv.nmk testci testansi testpollnone testmmqa shell: cmd From ac797a67ba0784a2f5e4685f9b4afc0540cce0e7 Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Tue, 17 Jan 2023 12:52:58 +0000 Subject: [PATCH 3/5] Removing unused variable to suppress compiler warnings on LII6LL. --- test/function/104.c | 2 +- test/function/97.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/function/104.c b/test/function/104.c index 392dc6c31b..1931446759 100644 --- a/test/function/104.c +++ b/test/function/104.c @@ -120,7 +120,7 @@ static mps_res_t area_scan(mps_ss_t ss, mps_addr_t base, mps_addr_t limit, void { mycell *obj = base; mps_res_t res; - mps_addr_t p, q; + mps_addr_t p; switch (obj->tag & 0x3) { diff --git a/test/function/97.c b/test/function/97.c index c6f0ff24b8..25c1a4f9ac 100644 --- a/test/function/97.c +++ b/test/function/97.c @@ -118,7 +118,7 @@ static mps_res_t area_scan(mps_ss_t ss, mps_addr_t base, mps_addr_t limit, void { mycell *obj = base; mps_res_t res; - mps_addr_t p, q; + mps_addr_t p; switch (obj->tag & 0x3) { From ed73ba8e96ca534c453f34ea425bc3ff9b103ebd Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Tue, 17 Jan 2023 12:55:34 +0000 Subject: [PATCH 4/5] Expressing the size of the array needed by fmtargs to suppress legit compiler warnings about overruns. --- test/test/testlib/myfmt.c | 4 +++- test/test/testlib/myfmt.h | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/test/test/testlib/myfmt.c b/test/test/testlib/myfmt.c index 385d01fa3c..0e05a15b60 100644 --- a/test/test/testlib/myfmt.c +++ b/test/test/testlib/myfmt.c @@ -47,7 +47,7 @@ struct mps_fmt_A_s fmtA = &mypad }; -void fmtargs(mps_arg_s args[MPS_ARGS_MAX]) +void fmtargs(mps_arg_s args[FMTARGS_ARGS_MAX]) { args[0].key = MPS_KEY_ALIGN; args[0].val.align = MPS_PF_ALIGN; @@ -62,6 +62,8 @@ void fmtargs(mps_arg_s args[MPS_ARGS_MAX]) args[5].key = MPS_KEY_FMT_PAD; args[5].val.fmt_pad = mypad; args[6].key = MPS_KEY_ARGS_END; + /* FIXME: Is asserts appropriate here? RB 2023-01-17 */ + asserts(FMTARGS_ARGS_MAX > 6, "not enough room for format arguments"); } mycell *allocheader(mps_ap_t ap, mps_word_t data, diff --git a/test/test/testlib/myfmt.h b/test/test/testlib/myfmt.h index 87db53e4e5..72c92795c9 100644 --- a/test/test/testlib/myfmt.h +++ b/test/test/testlib/myfmt.h @@ -45,6 +45,7 @@ mycell *allocone(mps_ap_t ap, mps_word_t data, mycell *allocheader(mps_ap_t ap, mps_word_t data, mycell *ref0, mycell *ref1, size_t size, size_t header); -void fmtargs(mps_arg_s args[MPS_ARGS_MAX]); +#define FMTARGS_ARGS_MAX 7 +void fmtargs(mps_arg_s args[FMTARGS_ARGS_MAX]); #endif From f2a6fcc8836387a69ed02a2d63427b10b5bb52f2 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Thu, 29 Dec 2022 15:47:10 +0000 Subject: [PATCH 5/5] Deduce arena grain size in MMQA test function/136.c. This makes the test portable to XCA6LL, where the page size (and so the minimum arena grain size) can be 16 kB. (cherry picked from commit ff8c9c9dcf8c8798ed8a7fd0507d60475bab812d) --- test/function/136.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/test/function/136.c b/test/function/136.c index 5ad00dcbf4..a326797ed9 100644 --- a/test/function/136.c +++ b/test/function/136.c @@ -6,7 +6,7 @@ TEST_HEADER link = testlib.o OUTPUT_SPEC assert = true - limit < 160000 + limit_grains < 40 END_HEADER */ @@ -155,22 +155,36 @@ static void test(void *stack_pointer) { mps_thr_t thread; int symm; - size_t grainSize = 4096; + size_t grainSize, smallSize = 8; size_t comlimit; mps_bool_t slotHigh, arenaHigh, firstFit; + mps_pool_t pool; + mps_addr_t addr; MPS_ARGS_BEGIN(args) { MPS_ARGS_ADD(args, MPS_KEY_ARENA_SIZE, 1024*1024*50); - MPS_ARGS_ADD(args, MPS_KEY_ARENA_GRAIN_SIZE, grainSize); cdie(mps_arena_create_k(&arena, mps_arena_class_vm(), args), "create arena"); } MPS_ARGS_END(args); + /* Deduce arena grain size by creating an MVFF pool, allocating a + * small object, and querying the total size. */ + MPS_ARGS_BEGIN(args) { + MPS_ARGS_ADD(args, MPS_KEY_EXTEND_BY, smallSize); + MPS_ARGS_ADD(args, MPS_KEY_MEAN_SIZE, smallSize); + die(mps_pool_create_k(&pool, arena, mps_class_mvff(), args), + "create MVFF pool"); + } MPS_ARGS_END(args); + die(mps_alloc(&addr, pool, smallSize), "allocate small object"); + grainSize = mps_pool_total_size(pool); + mps_free(pool, addr, smallSize); + mps_pool_destroy(pool); + cdie(mps_thread_reg(&thread, arena), "register thread"); for (comlimit = 128 * grainSize; comlimit > 0; comlimit -= grainSize) { mps_arena_commit_limit_set(arena, comlimit); - report("limit", "%d", comlimit); + report("limit_grains", "%d", comlimit / grainSize); symm = ranint(8); slotHigh = (symm >> 2) & 1; arenaHigh = (symm >> 1) & 1;