diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/binaryen.js/kitchen-sink.js | 1 | ||||
-rw-r--r-- | test/binaryen.js/kitchen-sink.js.txt | 3 | ||||
-rw-r--r-- | test/example/c-api-kitchen-sink.c | 1 | ||||
-rw-r--r-- | test/example/c-api-kitchen-sink.txt | 3 | ||||
-rw-r--r-- | test/lit/help/wasm-as.test | 4 | ||||
-rw-r--r-- | test/lit/help/wasm-ctor-eval.test | 4 | ||||
-rw-r--r-- | test/lit/help/wasm-dis.test | 4 | ||||
-rw-r--r-- | test/lit/help/wasm-emscripten-finalize.test | 4 | ||||
-rw-r--r-- | test/lit/help/wasm-metadce.test | 4 | ||||
-rw-r--r-- | test/lit/help/wasm-opt.test | 6 | ||||
-rw-r--r-- | test/lit/help/wasm-reduce.test | 4 | ||||
-rw-r--r-- | test/lit/help/wasm-split.test | 4 | ||||
-rw-r--r-- | test/lit/help/wasm2js.test | 6 | ||||
-rw-r--r-- | test/lit/validation/extended-const.wast | 24 | ||||
-rw-r--r-- | test/passes/strip-target-features_roundtrip_print-features_all-features.txt | 1 | ||||
-rw-r--r-- | test/unit/test_features.py | 1 |
16 files changed, 72 insertions, 2 deletions
diff --git a/test/binaryen.js/kitchen-sink.js b/test/binaryen.js/kitchen-sink.js index 30495d239..d72ffcec0 100644 --- a/test/binaryen.js/kitchen-sink.js +++ b/test/binaryen.js/kitchen-sink.js @@ -116,6 +116,7 @@ function test_features() { console.log("Features.Memory64: " + binaryen.Features.Memory64); console.log("Features.TypedFunctionReferences: " + binaryen.Features.TypedFunctionReferences); console.log("Features.RelaxedSIMD: " + binaryen.Features.RelaxedSIMD); + console.log("Features.ExtendedConst: " + binaryen.Features.ExtendedConst); console.log("Features.All: " + binaryen.Features.All); } diff --git a/test/binaryen.js/kitchen-sink.js.txt b/test/binaryen.js/kitchen-sink.js.txt index ed45591ea..376eee7f0 100644 --- a/test/binaryen.js/kitchen-sink.js.txt +++ b/test/binaryen.js/kitchen-sink.js.txt @@ -43,7 +43,8 @@ Features.GC: 1024 Features.Memory64: 2048 Features.TypedFunctionReferences: 4096 Features.RelaxedSIMD: 16384 -Features.All: 32767 +Features.ExtendedConst: 32768 +Features.All: 65535 InvalidId: 0 BlockId: 1 IfId: 2 diff --git a/test/example/c-api-kitchen-sink.c b/test/example/c-api-kitchen-sink.c index fb3fc87b0..90784d7ac 100644 --- a/test/example/c-api-kitchen-sink.c +++ b/test/example/c-api-kitchen-sink.c @@ -303,6 +303,7 @@ void test_features() { printf("BinaryenFeatureTypedFunctionReferences: %d\n", BinaryenFeatureTypedFunctionReferences()); printf("BinaryenFeatureRelaxedSIMD: %d\n", BinaryenFeatureRelaxedSIMD()); + printf("BinaryenFeatureExtendedConst: %d\n", BinaryenFeatureExtendedConst()); printf("BinaryenFeatureAll: %d\n", BinaryenFeatureAll()); } diff --git a/test/example/c-api-kitchen-sink.txt b/test/example/c-api-kitchen-sink.txt index f5e5d6d67..f759864a8 100644 --- a/test/example/c-api-kitchen-sink.txt +++ b/test/example/c-api-kitchen-sink.txt @@ -27,7 +27,8 @@ BinaryenFeatureGC: 1024 BinaryenFeatureMemory64: 2048 BinaryenFeatureTypedFunctionReferences: 4096 BinaryenFeatureRelaxedSIMD: 16384 -BinaryenFeatureAll: 32767 +BinaryenFeatureExtendedConst: 32768 +BinaryenFeatureAll: 65535 (f32.neg (f32.const -33.61199951171875) ) diff --git a/test/lit/help/wasm-as.test b/test/lit/help/wasm-as.test index cc3b350a7..50ab57355 100644 --- a/test/lit/help/wasm-as.test +++ b/test/lit/help/wasm-as.test @@ -100,6 +100,10 @@ ;; CHECK-NEXT: ;; CHECK-NEXT: --disable-relaxed-simd Disable relaxed SIMD ;; CHECK-NEXT: +;; CHECK-NEXT: --enable-extended-const Enable extended const expressions +;; CHECK-NEXT: +;; CHECK-NEXT: --disable-extended-const Disable extended const expressions +;; CHECK-NEXT: ;; CHECK-NEXT: --no-validation,-n Disables validation, assumes inputs are ;; CHECK-NEXT: correct ;; CHECK-NEXT: diff --git a/test/lit/help/wasm-ctor-eval.test b/test/lit/help/wasm-ctor-eval.test index 183094f8f..518d536e3 100644 --- a/test/lit/help/wasm-ctor-eval.test +++ b/test/lit/help/wasm-ctor-eval.test @@ -104,6 +104,10 @@ ;; CHECK-NEXT: ;; CHECK-NEXT: --disable-relaxed-simd Disable relaxed SIMD ;; CHECK-NEXT: +;; CHECK-NEXT: --enable-extended-const Enable extended const expressions +;; CHECK-NEXT: +;; CHECK-NEXT: --disable-extended-const Disable extended const expressions +;; CHECK-NEXT: ;; CHECK-NEXT: --no-validation,-n Disables validation, assumes inputs are ;; CHECK-NEXT: correct ;; CHECK-NEXT: diff --git a/test/lit/help/wasm-dis.test b/test/lit/help/wasm-dis.test index b4573d1a6..c2b4af271 100644 --- a/test/lit/help/wasm-dis.test +++ b/test/lit/help/wasm-dis.test @@ -93,6 +93,10 @@ ;; CHECK-NEXT: ;; CHECK-NEXT: --disable-relaxed-simd Disable relaxed SIMD ;; CHECK-NEXT: +;; CHECK-NEXT: --enable-extended-const Enable extended const expressions +;; CHECK-NEXT: +;; CHECK-NEXT: --disable-extended-const Disable extended const expressions +;; CHECK-NEXT: ;; CHECK-NEXT: --no-validation,-n Disables validation, assumes inputs are ;; CHECK-NEXT: correct ;; CHECK-NEXT: diff --git a/test/lit/help/wasm-emscripten-finalize.test b/test/lit/help/wasm-emscripten-finalize.test index 15ae1c176..2f9ae3a31 100644 --- a/test/lit/help/wasm-emscripten-finalize.test +++ b/test/lit/help/wasm-emscripten-finalize.test @@ -143,6 +143,10 @@ ;; CHECK-NEXT: ;; CHECK-NEXT: --disable-relaxed-simd Disable relaxed SIMD ;; CHECK-NEXT: +;; CHECK-NEXT: --enable-extended-const Enable extended const expressions +;; CHECK-NEXT: +;; CHECK-NEXT: --disable-extended-const Disable extended const expressions +;; CHECK-NEXT: ;; CHECK-NEXT: --no-validation,-n Disables validation, assumes inputs are ;; CHECK-NEXT: correct ;; CHECK-NEXT: diff --git a/test/lit/help/wasm-metadce.test b/test/lit/help/wasm-metadce.test index 80dfc3183..99a830065 100644 --- a/test/lit/help/wasm-metadce.test +++ b/test/lit/help/wasm-metadce.test @@ -141,6 +141,10 @@ ;; CHECK-NEXT: ;; CHECK-NEXT: --disable-relaxed-simd Disable relaxed SIMD ;; CHECK-NEXT: +;; CHECK-NEXT: --enable-extended-const Enable extended const expressions +;; CHECK-NEXT: +;; CHECK-NEXT: --disable-extended-const Disable extended const expressions +;; CHECK-NEXT: ;; CHECK-NEXT: --no-validation,-n Disables validation, assumes inputs are ;; CHECK-NEXT: correct ;; CHECK-NEXT: diff --git a/test/lit/help/wasm-opt.test b/test/lit/help/wasm-opt.test index 183106e4d..caf6437fc 100644 --- a/test/lit/help/wasm-opt.test +++ b/test/lit/help/wasm-opt.test @@ -593,6 +593,12 @@ ;; CHECK-NEXT: ;; CHECK-NEXT: --disable-relaxed-simd Disable relaxed SIMD ;; CHECK-NEXT: +;; CHECK-NEXT: --enable-extended-const Enable extended const +;; CHECK-NEXT: expressions +;; CHECK-NEXT: +;; CHECK-NEXT: --disable-extended-const Disable extended const +;; CHECK-NEXT: expressions +;; CHECK-NEXT: ;; CHECK-NEXT: --no-validation,-n Disables validation, assumes ;; CHECK-NEXT: inputs are correct ;; CHECK-NEXT: diff --git a/test/lit/help/wasm-reduce.test b/test/lit/help/wasm-reduce.test index 5c6cb05cc..2360ed508 100644 --- a/test/lit/help/wasm-reduce.test +++ b/test/lit/help/wasm-reduce.test @@ -129,6 +129,10 @@ ;; CHECK-NEXT: ;; CHECK-NEXT: --disable-relaxed-simd Disable relaxed SIMD ;; CHECK-NEXT: +;; CHECK-NEXT: --enable-extended-const Enable extended const expressions +;; CHECK-NEXT: +;; CHECK-NEXT: --disable-extended-const Disable extended const expressions +;; CHECK-NEXT: ;; CHECK-NEXT: --no-validation,-n Disables validation, assumes inputs are ;; CHECK-NEXT: correct ;; CHECK-NEXT: diff --git a/test/lit/help/wasm-split.test b/test/lit/help/wasm-split.test index 6319f475f..f79d1c0c7 100644 --- a/test/lit/help/wasm-split.test +++ b/test/lit/help/wasm-split.test @@ -187,6 +187,10 @@ ;; CHECK-NEXT: ;; CHECK-NEXT: --disable-relaxed-simd Disable relaxed SIMD ;; CHECK-NEXT: +;; CHECK-NEXT: --enable-extended-const Enable extended const expressions +;; CHECK-NEXT: +;; CHECK-NEXT: --disable-extended-const Disable extended const expressions +;; CHECK-NEXT: ;; CHECK-NEXT: --no-validation,-n Disables validation, assumes inputs are ;; CHECK-NEXT: correct ;; CHECK-NEXT: diff --git a/test/lit/help/wasm2js.test b/test/lit/help/wasm2js.test index 0b03efa27..ab169a1a3 100644 --- a/test/lit/help/wasm2js.test +++ b/test/lit/help/wasm2js.test @@ -555,6 +555,12 @@ ;; CHECK-NEXT: ;; CHECK-NEXT: --disable-relaxed-simd Disable relaxed SIMD ;; CHECK-NEXT: +;; CHECK-NEXT: --enable-extended-const Enable extended const +;; CHECK-NEXT: expressions +;; CHECK-NEXT: +;; CHECK-NEXT: --disable-extended-const Disable extended const +;; CHECK-NEXT: expressions +;; CHECK-NEXT: ;; CHECK-NEXT: --no-validation,-n Disables validation, assumes ;; CHECK-NEXT: inputs are correct ;; CHECK-NEXT: diff --git a/test/lit/validation/extended-const.wast b/test/lit/validation/extended-const.wast new file mode 100644 index 000000000..4269ca2b7 --- /dev/null +++ b/test/lit/validation/extended-const.wast @@ -0,0 +1,24 @@ +;; Test that shared memory requires atomics + +;; RUN: not wasm-opt %s 2>&1 | filecheck %s --check-prefix NO-EXTENDED +;; RUN: wasm-opt %s --enable-extended-const -o - -S | filecheck %s --check-prefix EXTENDED + +;; NO-EXTENDED: unexpected false: global init must be valid +;; NO-EXTENDED: unexpected false: memory segment offset should be reasonable + +;; EXTENDED: (import "env" "global" (global $gimport$0 i32)) +;; EXTENDED: (global $1 i32 (i32.add +;; EXTENDED: (global.get $gimport$0) +;; EXTENDED: (i32.const 42) +;; EXTENDED: )) +;; EXTENDED: (data (i32.sub +;; EXTENDED: (global.get $gimport$0) +;; EXTENDED: (i32.const 10) +;; EXTENDED: ) "hello world") + +(module + (memory 1 1) + (import "env" "global" (global i32)) + (global i32 (i32.add (global.get 0) (i32.const 42))) + (data (i32.sub (global.get 0) (i32.const 10)) "hello world") +) diff --git a/test/passes/strip-target-features_roundtrip_print-features_all-features.txt b/test/passes/strip-target-features_roundtrip_print-features_all-features.txt index 5feeecc20..53fd2b237 100644 --- a/test/passes/strip-target-features_roundtrip_print-features_all-features.txt +++ b/test/passes/strip-target-features_roundtrip_print-features_all-features.txt @@ -12,6 +12,7 @@ --enable-memory64 --enable-typed-function-references --enable-relaxed-simd +--enable-extended-const (module (type $none_=>_v128_externref (func (result v128 externref))) (func $foo (result v128 externref) diff --git a/test/unit/test_features.py b/test/unit/test_features.py index 93f715ef9..408084086 100644 --- a/test/unit/test_features.py +++ b/test/unit/test_features.py @@ -397,4 +397,5 @@ class TargetFeaturesSectionTest(utils.BinaryenTestCase): '--enable-memory64', '--enable-typed-function-references', '--enable-relaxed-simd', + '--enable-extended-const', ], p2.stdout.splitlines()) |