Skip to content

Commit

Permalink
Add global definitions for spectest and test modules in libc_builtin_…
Browse files Browse the repository at this point in the history
…wrapper
  • Loading branch information
lum1n0us committed Dec 12, 2024
1 parent fd7dee5 commit 36b8555
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions core/iwasm/libraries/libc-builtin/libc_builtin_wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -1129,6 +1129,26 @@ get_spectest_export_apis(NativeSymbol **p_libc_builtin_apis)
*************************************/

static WASMNativeGlobalDef native_global_defs[] = {
#if WASM_ENABLE_MULTI_MODULE != 0
#if WASM_ENABLE_SPEC_TEST != 0
{ "spectest", "global_i32", VALUE_TYPE_I32, false, .value.i32 = 666 },
{ "spectest", "global_i64", VALUE_TYPE_I64, false, .value.i64 = 666 },
{ "spectest", "global_f32", VALUE_TYPE_F32, false, .value.f32 = 666.6 },
{ "spectest", "global_f64", VALUE_TYPE_F64, false, .value.f64 = 666.6 },
{ "test", "global-i32", VALUE_TYPE_I32, false, .value.i32 = 0 },
{ "test", "global-f32", VALUE_TYPE_F32, false, .value.f32 = 0 },
{ "test", "global-mut-i32", VALUE_TYPE_I32, true, .value.i32 = 0 },
{ "test", "global-mut-i64", VALUE_TYPE_I64, true, .value.i64 = 0 },
{ "test", "g", VALUE_TYPE_I32, true, .value.i32 = 0 },

#if WASM_ENABLE_GC != 0
{ "G", "g", VALUE_TYPE_I32, false, .value.i32 = 4 },
{ "M", "g", REF_TYPE_HT_NON_NULLABLE, false, .value.gc_obj = 0 },
#endif

#endif /* WASM_ENABLE_SPEC_TEST != 0 */
#endif /* WASM_ENABLE_MULTI_MODULE != 0 */

{ "global", "NaN", VALUE_TYPE_F64, false,
.value.u64 = 0x7FF8000000000000LL },
{ "global", "Infinity", VALUE_TYPE_F64, false,
Expand Down

0 comments on commit 36b8555

Please sign in to comment.