Skip to content

Commit

Permalink
fix malloc test
Browse files Browse the repository at this point in the history
  • Loading branch information
contrun committed Sep 7, 2023
1 parent 711bebe commit 6854e7f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tests/ckb-c-stdlib-tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ TARGET := riscv64-unknown-linux-gnu
CC := $(TARGET)-gcc
LD := $(TARGET)-gcc
OBJCOPY := $(TARGET)-objcopy
CFLAGS := -fPIC -O3 -fno-builtin -nostdinc -nostdlib -nostartfiles -fvisibility=hidden -fdata-sections -ffunction-sections -I ../../include/ckb-c-stdlib -I ../../include/ckb-c-stdlib/libc -Wall -Werror -Wno-nonnull -Wno-nonnull-compare -Wno-unused-function -g
CFLAGS := -fPIC -O3 -fno-builtin -nostdinc -nostdlib -nostartfiles -fvisibility=hidden -fdata-sections -ffunction-sections -I ../../lualib/c-stdlib -I ../../lualib/c-stdlib/src -Wall -Werror -Wno-nonnull -Wno-nonnull-compare -Wno-unused-function -g
LDFLAGS := -nostartfiles -Wl,-static -Wl,--gc-sections

# docker pull nervos/ckb-riscv-gnu-toolchain:gnu-bionic-20191012
Expand Down
7 changes: 3 additions & 4 deletions tests/ckb-c-stdlib-tests/test_malloc.c
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
#define CKB_C_STDLIB_PRINTF
#define CKB_C_STDLIB_MALLOC
#define PRINTF_DISABLE_SUPPORT_FLOAT
#define CKB_MALLOC_DECLARATION_ONLY 1
#define CKB_PRINTF_DECLARATION_ONLY 1

#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>

#include "malloc_impl.h"
#include "ckb_syscalls.h"
#include "helper.h"

extern void malloc_config(uintptr_t min, uintptr_t max);
#define COUNT_OF(a) (sizeof(a) / sizeof(a[0]))

void check_heap(void) {
Expand Down

0 comments on commit 6854e7f

Please sign in to comment.