summaryrefslogtreecommitdiff
path: root/test/lit/nominal-named-field.wast
diff options
context:
space:
mode:
Diffstat (limited to 'test/lit/nominal-named-field.wast')
-rw-r--r--test/lit/nominal-named-field.wast30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/lit/nominal-named-field.wast b/test/lit/nominal-named-field.wast
new file mode 100644
index 000000000..5dd33d99e
--- /dev/null
+++ b/test/lit/nominal-named-field.wast
@@ -0,0 +1,30 @@
+;; NOTE: Assertions have been generated by update_lit_checks.py and should not be edited.
+
+;; Regression test for a bug in which field names were not printed in nominal mode.
+
+;; RUN: wasm-opt %s -all --nominal -S -o - | filecheck %s
+;; RUN: wasm-opt %s -all --nominal --roundtrip -S -o - | filecheck %s
+
+(module
+ ;; CHECK: (type $struct (struct (field (mut i32)) (field f32) (field $named f64)))
+ (type $struct (struct
+ (field (mut i32))
+ (field f32)
+ (field $named f64)
+ ))
+
+ ;; CHECK: (func $foo (param $0 (ref $struct))
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (struct.get $struct $named
+ ;; CHECK-NEXT: (local.get $0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ (func $foo (param (ref $struct))
+ (drop
+ (struct.get $struct $named
+ (local.get 0)
+ )
+ )
+ )
+)