summaryrefslogtreecommitdiffstats
path: root/third_party/rust/wasm-smith/tests/exports.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:37 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:37 +0000
commita90a5cba08fdf6c0ceb95101c275108a152a3aed (patch)
tree532507288f3defd7f4dcf1af49698bcb76034855 /third_party/rust/wasm-smith/tests/exports.rs
parentAdding debian version 126.0.1-1. (diff)
downloadfirefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.tar.xz
firefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.zip
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/rust/wasm-smith/tests/exports.rs')
-rw-r--r--third_party/rust/wasm-smith/tests/exports.rs32
1 files changed, 17 insertions, 15 deletions
diff --git a/third_party/rust/wasm-smith/tests/exports.rs b/third_party/rust/wasm-smith/tests/exports.rs
index ff1dac0cbe..6d3e4451a2 100644
--- a/third_party/rust/wasm-smith/tests/exports.rs
+++ b/third_party/rust/wasm-smith/tests/exports.rs
@@ -1,3 +1,5 @@
+#![cfg(feature = "wasmparser")]
+
use arbitrary::{Arbitrary, Unstructured};
use rand::{rngs::SmallRng, RngCore, SeedableRng};
use wasm_smith::{Config, Module};
@@ -18,9 +20,9 @@ enum ExportType {
fn smoke_test_single_export() {
let test = r#"
(module
- (func (export "foo") (param i32) (result i64)
- unreachable
- )
+ (func (export "foo") (param i32) (result i64)
+ unreachable
+ )
)
"#;
smoke_test_exports(test, 11)
@@ -30,15 +32,15 @@ fn smoke_test_single_export() {
fn smoke_test_multiple_exports() {
let test = r#"
(module
- (func (export "a") (param i32) (result i64)
- unreachable
- )
- (func (export "b")
- unreachable
- )
- (func (export "c")
- unreachable
- )
+ (func (export "a") (param i32) (result i64)
+ unreachable
+ )
+ (func (export "b")
+ unreachable
+ )
+ (func (export "c")
+ unreachable
+ )
)
"#;
smoke_test_exports(test, 12)
@@ -48,9 +50,9 @@ fn smoke_test_multiple_exports() {
fn smoke_test_exported_global() {
let test = r#"
(module
- (func (export "a") (param i32 i32 f32 f64) (result f32)
- unreachable
- )
+ (func (export "a") (param i32 i32 f32 f64) (result f32)
+ unreachable
+ )
(global (export "glob") f64 f64.const 0)
)
"#;