Skip to content

Commit 841e180

Browse files
committed
Added tests
1 parent a099773 commit 841e180

File tree

3 files changed

+40
-1
lines changed

3 files changed

+40
-1
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
a = HEAP8[x];
2+
HEAP8[x] = a;
3+
a = HEAPU8[x];
4+
HEAPU8[x] = a;
5+
a = LE_HEAP_LOAD_I16(x * 2);
6+
LE_HEAP_STORE_I16(x * 2, a);
7+
a = LE_HEAP_LOAD_U16(x * 2);
8+
LE_HEAP_STORE_U16(x * 2, a);
9+
a = LE_HEAP_LOAD_I32(x * 4);
10+
LE_HEAP_STORE_I32(x * 4, a);
11+
a = LE_HEAP_LOAD_U32(x * 4);
12+
LE_HEAP_STORE_U32(x * 4, a);
13+
a = LE_HEAP_LOAD_F32(x * 4);
14+
LE_HEAP_STORE_F32(x * 4, a);
15+
a = LE_HEAP_LOAD_F64(x * 8);
16+
LE_HEAP_STORE_F64(x * 8, a);
17+
HEAP[x];
18+
HeAp[x];
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
a = HEAP8[x]; // HEAP8
2+
HEAP8[x] = a;
3+
a = HEAPU8[x]; // HEAPU8
4+
HEAPU8[x] = a;
5+
a = HEAP16[x]; // HEAP16
6+
HEAP16[x] = a;
7+
a = HEAPU16[x]; // HEAPU16
8+
HEAPU16[x] = a;
9+
a = HEAP32[x]; // HEAPI32
10+
HEAP32[x] = a;
11+
a = HEAPU32[x]; // HEAPU32
12+
HEAPU32[x] = a;
13+
a = HEAPF32[x]; // HEAPF32
14+
HEAPF32[x] = a;
15+
a = HEAPF64[x]; // HEAPF64
16+
HEAPF64[x] = a;
17+
HEAP[x]; // should not be changed
18+
HeAp[x];

tests/test_other.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1814,7 +1814,8 @@ def test_js_optimizer(self):
18141814
'growableHeap',
18151815
'unsignPointers',
18161816
'asanify',
1817-
'safeHeap'
1817+
'safeHeap',
1818+
'littleEndianHeap'
18181819
]
18191820
for input, expected, passes in [
18201821
(path_from_root('tests', 'optimizer', 'test-js-optimizer-minifyLocals.js'), open(path_from_root('tests', 'optimizer', 'test-js-optimizer-minifyLocals-output.js')).read(),
@@ -1861,6 +1862,8 @@ def test_js_optimizer(self):
18611862
['asanify']),
18621863
(path_from_root('tests', 'optimizer', 'test-safeHeap.js'), open(path_from_root('tests', 'optimizer', 'test-safeHeap-output.js')).read(),
18631864
['safeHeap']),
1865+
(path_from_root('tests', 'optimizer', 'test-LittleEndianHeap.js'), open(path_from_root('tests', 'optimizer', 'test-LittleEndianHeap-output.js')).read(),
1866+
['littleEndianHeap']),
18641867
]:
18651868
print(input, passes)
18661869

0 commit comments

Comments
 (0)