diff options
Diffstat (limited to 'test/example')
-rw-r--r-- | test/example/c-api-kitchen-sink.c | 7 | ||||
-rw-r--r-- | test/example/c-api-kitchen-sink.txt | 10 | ||||
-rw-r--r-- | test/example/relooper-fuzz.txt | 4 | ||||
-rw-r--r-- | test/example/relooper-fuzz1.txt | 4 |
4 files changed, 20 insertions, 5 deletions
diff --git a/test/example/c-api-kitchen-sink.c b/test/example/c-api-kitchen-sink.c index e5b614bec..66cf43290 100644 --- a/test/example/c-api-kitchen-sink.c +++ b/test/example/c-api-kitchen-sink.c @@ -2008,12 +2008,17 @@ void test_binaries() { BinaryenModuleWriteText(module, buffer, 1024); printf("module s-expr printed (in memory):\n%s\n", buffer); - // writ the s-expr representation to a pointer which is managed by the + // write the s-expr representation to a pointer which is managed by the // caller char* text = BinaryenModuleAllocateAndWriteText(module); printf("module s-expr printed (in memory, caller-owned):\n%s\n", text); free(text); + // write StackIR + text = BinaryenModuleAllocateAndWriteStackIR(module); + printf("module s-expr printed (StackIR):\n%s\n", text); + free(text); + BinaryenModuleDispose(module); } diff --git a/test/example/c-api-kitchen-sink.txt b/test/example/c-api-kitchen-sink.txt index 8bdf1ba52..fe784a453 100644 --- a/test/example/c-api-kitchen-sink.txt +++ b/test/example/c-api-kitchen-sink.txt @@ -3140,6 +3140,16 @@ module s-expr printed (in memory, caller-owned): ) ) +module s-expr printed (StackIR): +(module + (type $0 (func (param i32 i32) (result i32))) + (func $adder (param $0 i32) (param $1 i32) (result i32) + local.get $0 + local.get $1 + i32.add + ) +) + (module (type $0 (func (param i32))) (type $1 (func)) diff --git a/test/example/relooper-fuzz.txt b/test/example/relooper-fuzz.txt index 1030fac32..e4c3f6db4 100644 --- a/test/example/relooper-fuzz.txt +++ b/test/example/relooper-fuzz.txt @@ -311,7 +311,7 @@ (memory $0 1 1) (export "mem" (memory $0)) (start $main) - (func $check (; has Stack IR ;) (result i32) + (func $check (result i32) (if (i32.eq (i32.load @@ -348,7 +348,7 @@ ) ) ) - (func $main (; has Stack IR ;) + (func $main (local $0 i32) (local $1 i32) (i32.store diff --git a/test/example/relooper-fuzz1.txt b/test/example/relooper-fuzz1.txt index 3cdb12e69..675d51042 100644 --- a/test/example/relooper-fuzz1.txt +++ b/test/example/relooper-fuzz1.txt @@ -293,7 +293,7 @@ (memory $0 1 1) (export "mem" (memory $0)) (start $main) - (func $check (; has Stack IR ;) (result i32) + (func $check (result i32) (if (i32.eq (i32.load @@ -330,7 +330,7 @@ ) ) ) - (func $main (; has Stack IR ;) + (func $main (local $0 i32) (i32.store (i32.const 8) |