diff options
author | Shravan Narayan <shravanrn@gmail.com> | 2023-04-29 15:37:23 -0400 |
---|---|---|
committer | Shravan Narayan <shravanrn@gmail.com> | 2023-05-02 14:27:21 -0400 |
commit | 5abbeaab97eb802acccf866d9c8cc021c1f7e570 (patch) | |
tree | 54380ba2ead12f36b1cf7b16aa2f68d2617fc9ef /test | |
parent | 4d9a1475a744ab78e7fbc3dc60bf7038dad6119d (diff) | |
download | wabt-5abbeaab97eb802acccf866d9c8cc021c1f7e570.tar.gz wabt-5abbeaab97eb802acccf866d9c8cc021c1f7e570.tar.bz2 wabt-5abbeaab97eb802acccf866d9c8cc021c1f7e570.zip |
wasm2c: Enable exceptions and simd according to command line flags
Diffstat (limited to 'test')
-rwxr-xr-x | test/run-spec-wasm2c.py | 8 | ||||
-rw-r--r-- | test/spec-wasm2c-prefix.c | 1 | ||||
-rw-r--r-- | test/wasm2c/add.txt | 6 | ||||
-rw-r--r-- | test/wasm2c/check-imports.txt | 6 | ||||
-rw-r--r-- | test/wasm2c/export-names.txt | 6 | ||||
-rw-r--r-- | test/wasm2c/hello.txt | 6 | ||||
-rw-r--r-- | test/wasm2c/minimal.txt | 6 |
7 files changed, 36 insertions, 3 deletions
diff --git a/test/run-spec-wasm2c.py b/test/run-spec-wasm2c.py index 7bb73b43..d604f653 100755 --- a/test/run-spec-wasm2c.py +++ b/test/run-spec-wasm2c.py @@ -452,15 +452,13 @@ def Compile(cc, c_filename, out_dir, *cflags): o_filename = utils.ChangeDir(utils.ChangeExt(c_filename, ext), out_dir) args = list(cflags) if IS_WINDOWS: - args += ['/nologo', '/DWASM_RT_ENABLE_SIMD', - '/MDd', '/c', c_filename, '/Fo' + o_filename] + args += ['/nologo', '/MDd', '/c', c_filename, '/Fo' + o_filename] else: # See "Compiling the wasm2c output" section of wasm2c/README.md # When compiling with -O2, GCC and clang require '-fno-optimize-sibling-calls' # and '-frounding-math' to maintain conformance with the spec tests # (GCC also requires '-fsignaling-nans') args += ['-c', c_filename, '-o', o_filename, '-O2', - '-DWASM_RT_ENABLE_SIMD', '-Wall', '-Werror', '-Wno-unused', '-Wno-ignored-optimization-argument', '-Wno-tautological-constant-out-of-range-compare', @@ -622,6 +620,10 @@ def main(args): wasm_rt_impl_c = os.path.join(options.wasmrt_dir, 'wasm-rt-impl.c') o_filenames.append(Compile(cc, wasm_rt_impl_c, out_dir, *cflags)) + # Compile wasm-rt-exceptions. + wasm_rt_exceptions_c = os.path.join(options.wasmrt_dir, 'wasm-rt-exceptions-impl.c') + o_filenames.append(Compile(cc, wasm_rt_exceptions_c, out_dir, *cflags)) + # Compile and link -main test run entry point o_filenames.append(Compile(cc, main_filename, out_dir, *cflags)) if IS_WINDOWS: diff --git a/test/spec-wasm2c-prefix.c b/test/spec-wasm2c-prefix.c index c82a882d..b2f5d103 100644 --- a/test/spec-wasm2c-prefix.c +++ b/test/spec-wasm2c-prefix.c @@ -11,6 +11,7 @@ #include "wasm-rt.h" #include "wasm-rt-impl.h" +#include "wasm-rt-exceptions.h" static int g_tests_run; static int g_tests_passed; diff --git a/test/wasm2c/add.txt b/test/wasm2c/add.txt index e84befab..a5a7197d 100644 --- a/test/wasm2c/add.txt +++ b/test/wasm2c/add.txt @@ -8,10 +8,16 @@ #ifndef WASM_H_GENERATED_ #define WASM_H_GENERATED_ +#define WASM_RT_ENABLE_SIMD + #include <stdint.h> #include "wasm-rt.h" +#if defined(WASM_RT_ENABLE_EXCEPTION_HANDLING) +#include "wasm-rt-exceptions.h" +#endif + #if defined(WASM_RT_ENABLE_SIMD) #include "simde/wasm/simd128.h" #endif diff --git a/test/wasm2c/check-imports.txt b/test/wasm2c/check-imports.txt index cdfca122..73f59b22 100644 --- a/test/wasm2c/check-imports.txt +++ b/test/wasm2c/check-imports.txt @@ -21,10 +21,16 @@ #ifndef WASM_H_GENERATED_ #define WASM_H_GENERATED_ +#define WASM_RT_ENABLE_SIMD + #include <stdint.h> #include "wasm-rt.h" +#if defined(WASM_RT_ENABLE_EXCEPTION_HANDLING) +#include "wasm-rt-exceptions.h" +#endif + #if defined(WASM_RT_ENABLE_SIMD) #include "simde/wasm/simd128.h" #endif diff --git a/test/wasm2c/export-names.txt b/test/wasm2c/export-names.txt index e24984b3..09cae5b1 100644 --- a/test/wasm2c/export-names.txt +++ b/test/wasm2c/export-names.txt @@ -11,10 +11,16 @@ #ifndef WASM_H_GENERATED_ #define WASM_H_GENERATED_ +#define WASM_RT_ENABLE_SIMD + #include <stdint.h> #include "wasm-rt.h" +#if defined(WASM_RT_ENABLE_EXCEPTION_HANDLING) +#include "wasm-rt-exceptions.h" +#endif + #if defined(WASM_RT_ENABLE_SIMD) #include "simde/wasm/simd128.h" #endif diff --git a/test/wasm2c/hello.txt b/test/wasm2c/hello.txt index 418916ca..ea3bf426 100644 --- a/test/wasm2c/hello.txt +++ b/test/wasm2c/hello.txt @@ -26,10 +26,16 @@ #ifndef WASM_H_GENERATED_ #define WASM_H_GENERATED_ +#define WASM_RT_ENABLE_SIMD + #include <stdint.h> #include "wasm-rt.h" +#if defined(WASM_RT_ENABLE_EXCEPTION_HANDLING) +#include "wasm-rt-exceptions.h" +#endif + #if defined(WASM_RT_ENABLE_SIMD) #include "simde/wasm/simd128.h" #endif diff --git a/test/wasm2c/minimal.txt b/test/wasm2c/minimal.txt index d4efc0d5..669b3d8e 100644 --- a/test/wasm2c/minimal.txt +++ b/test/wasm2c/minimal.txt @@ -5,10 +5,16 @@ #ifndef WASM_H_GENERATED_ #define WASM_H_GENERATED_ +#define WASM_RT_ENABLE_SIMD + #include <stdint.h> #include "wasm-rt.h" +#if defined(WASM_RT_ENABLE_EXCEPTION_HANDLING) +#include "wasm-rt-exceptions.h" +#endif + #if defined(WASM_RT_ENABLE_SIMD) #include "simde/wasm/simd128.h" #endif |