-
Notifications
You must be signed in to change notification settings - Fork 629
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add testcases for shared heap and fix POP_MEM_OFFSET of memory64 (#3916)
- add testcases for shared_heap - fix POP_MEM_OFFSET and POP_TBL_ELEM_IDX of memory64 Signed-off-by: wenlingyun1 <[email protected]>
- Loading branch information
Showing
6 changed files
with
197 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Copyright (C) 2024 Xiaomi Corporation. All rights reserved. | ||
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
*/ | ||
|
||
#include <stdio.h> | ||
|
||
extern void * | ||
shared_heap_malloc(int size); | ||
extern void | ||
shared_heap_free(void *offset); | ||
extern void * | ||
test_addr_conv(void *ptr); | ||
|
||
int | ||
test() | ||
{ | ||
int *ptr = NULL; | ||
int *ptr2 = NULL; | ||
|
||
ptr = (int *)shared_heap_malloc(4); | ||
|
||
if (ptr == NULL) { | ||
return 0; | ||
} | ||
ptr2 = test_addr_conv(ptr); | ||
if (ptr2 != ptr) { | ||
return 0; | ||
} | ||
shared_heap_free(ptr); | ||
return 1; | ||
} |