summaryrefslogtreecommitdiff
path: root/test/lit/passes/metrics.wast
diff options
context:
space:
mode:
Diffstat (limited to 'test/lit/passes/metrics.wast')
-rw-r--r--test/lit/passes/metrics.wast30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/lit/passes/metrics.wast b/test/lit/passes/metrics.wast
new file mode 100644
index 000000000..5a210ae6d
--- /dev/null
+++ b/test/lit/passes/metrics.wast
@@ -0,0 +1,30 @@
+;; Test that we can pass an optional title to metrics instances.
+;;
+;; RUN: wasm-opt %s --metrics --metrics=second --remove-unused-module-elements --metrics=third --metrics -q | filecheck %s
+;;
+;; The number of functions decreases to 0 after --remove-unused-module-elements,
+;; showing that we display the proper metrics at each point in time.
+;;
+;; CHECK: Metrics
+;; CHECK-NEXT: total
+;; CHECK-NEXT: [exports] : 0
+;; CHECK-NEXT: [funcs] : 1
+;;
+;; CHECK: Metrics: second
+;; CHECK-NEXT: total
+;; CHECK-NEXT: [exports] : 0
+;; CHECK-NEXT: [funcs] : 1
+;;
+;; CHECK: Metrics: third
+;; CHECK-NEXT: total
+;; CHECK-NEXT: [exports] : 0
+;; CHECK-NEXT: [funcs] : 0 -1
+;;
+;; CHECK: Metrics
+;; CHECK-NEXT: total
+;; CHECK-NEXT: [exports] : 0
+;; CHECK-NEXT: [funcs] : 0
+
+(module
+ (func $foo)
+)