1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-16 08:10:43 -08:00
emacs/mps/qa/function/143.c
Richard Tucker 38946073e2 New unit
new test

Copied from Perforce
 Change: 20148
 ServerID: perforce.ravenbrook.com
1998-09-29 13:34:28 +01:00

57 lines
1.1 KiB
C

/* $HopeName: MMQA_test_function!136.c(trunk.2) $
TEST_HEADER
summary = EPDR fenceposting check: free
language = c
link = testlib.o
OUTPUT_SPEC
assert = true
assertfile = .\dbgpool.c
assertcond = FenceCheck(debug, pool, old, size)
END_HEADER
*/
#include "testlib.h"
#include "mpscepdl.h"
#include "mpsavm.h"
void *stackpointer;
mps_arena_t arena;
static mps_pool_debug_option_s debugOpts = {(void *)"bibblebo", 8};
static void test(void) {
mps_thr_t thread;
mps_pool_t pool;
mps_addr_t a;
char * c;
cdie(mps_arena_create(&arena, mps_arena_class_vmnz(),
(size_t) (1024*1024*50)), "create arena");
cdie(mps_thread_reg(&thread, arena), "register thread");
die(
mps_pool_create(&pool, arena, mps_class_epdr_debug(), &debugOpts,
8192, 8, 8),
"create MVFF pool");
die(mps_alloc(&a, pool, 63), "alloc a");
c = a;
c += 63;
*c = 0;
mps_free(pool, a, 63);
mps_pool_destroy(pool);
mps_thread_dereg(thread);
mps_arena_destroy(arena);
}
int main(void) {
void *m;
stackpointer=&m; /* hack to get stack pointer */
easy_tramp(test);
pass();
return 0;
}