File tree Expand file tree Collapse file tree 3 files changed +30
-6
lines changed Expand file tree Collapse file tree 3 files changed +30
-6
lines changed Original file line number Diff line number Diff line change 2828 (global $~lib/rt/itcms/fromSpace (mut i32 ) (i32.const 0 ))
2929 (global $~lib/rt/tlsf/ROOT (mut i32 ) (i32.const 0 ))
3030 (global $~lib/native/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0 ))
31+ (global $logical/foo (mut i32 ) (i32.const 456 ))
32+ (global $logical/bar (mut f64 ) (f64.const -0 ))
33+ (global $logical/baz (mut i32 ) (i32.const 321 ))
34+ (global $logical/qux (mut f64 ) (f64.const 2.718 ))
3135 (global $logical/b (mut i32 ) (i32.const 0 ))
3236 (global $logical/c (mut i32 ) (i32.const 0 ))
3337 (global $~lib/rt/__rtti_base i32 (i32.const 464 ))
4751 (data $9 (i32.const 464 ) " \08\00\00\00 \00\00\00 \00\00\00 \00\00\00\00\00\00\00 \00\00\00 \00\00\00 \00\00\00 \00\00\00 " )
4852 (table $0 1 1 funcref )
4953 (elem $0 (i32.const 1 ))
54+ (export " foo" (global $logical/foo ))
55+ (export " bar" (global $logical/bar ))
56+ (export " baz" (global $logical/baz ))
57+ (export " qux" (global $logical/qux ))
5058 (export " memory" (memory $0 ))
5159 (start $~start )
5260 (func $logical/testShortcutAnd (param $a i64 ) (param $b i32 ) (result i32 )
29262934 if
29272935 i32.const 0
29282936 i32.const 32
2929- i32.const 106
2937+ i32.const 114
29302938 i32.const 1
29312939 call $~lib/builtins/abort
29322940 unreachable
29392947 if
29402948 i32.const 0
29412949 i32.const 32
2942- i32.const 107
2950+ i32.const 115
29432951 i32.const 1
29442952 call $~lib/builtins/abort
29452953 unreachable
29572965 if
29582966 i32.const 0
29592967 i32.const 32
2960- i32.const 112
2968+ i32.const 120
29612969 i32.const 1
29622970 call $~lib/builtins/abort
29632971 unreachable
29702978 if
29712979 i32.const 0
29722980 i32.const 32
2973- i32.const 113
2981+ i32.const 121
29742982 i32.const 1
29752983 call $~lib/builtins/abort
29762984 unreachable
Original file line number Diff line number Diff line change 1717 (global $~lib/rt/itcms/white (mut i32 ) (i32.const 0 ))
1818 (global $~lib/rt/itcms/fromSpace (mut i32 ) (i32.const 0 ))
1919 (global $~lib/rt/tlsf/ROOT (mut i32 ) (i32.const 0 ))
20+ (global $logical/foo (mut i32 ) (i32.const 456 ))
21+ (global $logical/bar (mut f64 ) (f64.const -0 ))
22+ (global $logical/baz (mut i32 ) (i32.const 321 ))
23+ (global $logical/qux (mut f64 ) (f64.const 2.718 ))
2024 (global $logical/b (mut i32 ) (i32.const 0 ))
2125 (global $logical/c (mut i32 ) (i32.const 0 ))
2226 (global $~lib/memory/__stack_pointer (mut i32 ) (i32.const 34292 ))
3438 (data $8 (i32.const 1420 ) " <" )
3539 (data $8.1 (i32.const 1432 ) " \02\00\00\00\1e\00\00\00 ~\00 l\00 i\00 b\00 /\00 r\00 t\00 /\00 t\00 l\00 s\00 f\00 .\00 t\00 s" )
3640 (data $9 (i32.const 1488 ) " \08\00\00\00 \00\00\00 \00\00\00 \00\00\00\00\00\00\00 \00\00\00 \00\00\00 \00\00\00 " )
41+ (export " foo" (global $logical/foo ))
42+ (export " bar" (global $logical/bar ))
43+ (export " baz" (global $logical/baz ))
44+ (export " qux" (global $logical/qux ))
3745 (export " memory" (memory $0 ))
3846 (start $~start )
3947 (func $~lib/rt/itcms/visitRoots
15681576 if
15691577 i32.const 0
15701578 i32.const 1056
1571- i32.const 106
1579+ i32.const 114
15721580 i32.const 1
15731581 call $~lib/builtins/abort
15741582 unreachable
15861594 if
15871595 i32.const 0
15881596 i32.const 1056
1589- i32.const 112
1597+ i32.const 120
15901598 i32.const 1
15911599 call $~lib/builtins/abort
15921600 unreachable
Original file line number Diff line number Diff line change @@ -91,6 +91,14 @@ function testContextualBoolOr(someObj: Obj, someInt: i32): bool {
9191}
9292assert ( testContextualBoolOr ( new Obj ( ) , 0 ) ) ;
9393
94+ // Test simplification with precomputable LHS operands
95+ // see: https://github.com/AssemblyScript/assemblyscript/issues/2946
96+
97+ export let foo = 123 && 456
98+ export let bar = - 0.0 && 1.23
99+ export let baz = 321 || 654
100+ export let qux = NaN || 2.718
101+
94102// Common type
95103
96104class A { }
You can’t perform that action at this time.
0 commit comments