summaryrefslogtreecommitdiff
path: root/test/lit
diff options
context:
space:
mode:
Diffstat (limited to 'test/lit')
-rw-r--r--test/lit/help/wasm-as.test4
-rw-r--r--test/lit/help/wasm-ctor-eval.test4
-rw-r--r--test/lit/help/wasm-dis.test4
-rw-r--r--test/lit/help/wasm-emscripten-finalize.test4
-rw-r--r--test/lit/help/wasm-metadce.test4
-rw-r--r--test/lit/help/wasm-opt.test6
-rw-r--r--test/lit/help/wasm-reduce.test4
-rw-r--r--test/lit/help/wasm-split.test4
-rw-r--r--test/lit/help/wasm2js.test6
-rw-r--r--test/lit/validation/extended-const.wast24
10 files changed, 64 insertions, 0 deletions
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")
+)