@@ -56,45 +56,35 @@ jobs:
5656
5757 describe('Hermes switch jump-table normalization', () => {
5858 test('normalizes only the StringSwitchImm jump-table offset', () => {
59- const baseline = normalize(
60- ' StringSwitchImm r13, 2, 4024, L146, 150',
59+ const baseline = normalize(' StringSwitchImm r13, 2, 4024, L146, 150');
60+ expect(baseline).toBe(' StringSwitchImm r13, 2, <jt>, L146, 150');
61+ expect(normalize(' StringSwitchImm r13, 2, 4025, L146, 150')).toBe(
62+ baseline,
6163 );
62- expect(baseline).toBe(
63- ' StringSwitchImm r13, 2, <jt>, L146, 150',
64+ expect(normalize(' StringSwitchImm r13, 3, 4024, L146, 150')).not.toBe(
65+ baseline,
66+ );
67+ expect(normalize(' StringSwitchImm r13, 2, 4024, L147, 150')).not.toBe(
68+ baseline,
69+ );
70+ expect(normalize(' StringSwitchImm r13, 2, 4024, L146, 151')).not.toBe(
71+ baseline,
6472 );
65- expect(
66- normalize(' StringSwitchImm r13, 2, 4025, L146, 150'),
67- ).toBe(baseline);
68- expect(
69- normalize(' StringSwitchImm r13, 3, 4024, L146, 150'),
70- ).not.toBe(baseline);
71- expect(
72- normalize(' StringSwitchImm r13, 2, 4024, L147, 150'),
73- ).not.toBe(baseline);
74- expect(
75- normalize(' StringSwitchImm r13, 2, 4024, L146, 151'),
76- ).not.toBe(baseline);
7773 });
7874
7975 test('normalizes only the UIntSwitchImm jump-table offset', () => {
80- const baseline = normalize(
81- ' UIntSwitchImm r40, 5937, L3, 0, 31',
76+ const baseline = normalize(' UIntSwitchImm r40, 5937, L3, 0, 31');
77+ expect(baseline).toBe(' UIntSwitchImm r40, <jt>, L3, 0, 31');
78+ expect(normalize(' UIntSwitchImm r40, 5938, L3, 0, 31')).toBe(baseline);
79+ expect(normalize(' UIntSwitchImm r40, 5937, L4, 0, 31')).not.toBe(
80+ baseline,
81+ );
82+ expect(normalize(' UIntSwitchImm r40, 5937, L3, 1, 31')).not.toBe(
83+ baseline,
8284 );
83- expect(baseline) .toBe(
84- ' UIntSwitchImm r40, <jt>, L3, 0, 31' ,
85+ expect(normalize(' UIntSwitchImm r40, 5937, L3, 0, 32')).not .toBe(
86+ baseline ,
8587 );
86- expect(
87- normalize(' UIntSwitchImm r40, 5938, L3, 0, 31'),
88- ).toBe(baseline);
89- expect(
90- normalize(' UIntSwitchImm r40, 5937, L4, 0, 31'),
91- ).not.toBe(baseline);
92- expect(
93- normalize(' UIntSwitchImm r40, 5937, L3, 1, 31'),
94- ).not.toBe(baseline);
95- expect(
96- normalize(' UIntSwitchImm r40, 5937, L3, 0, 32'),
97- ).not.toBe(baseline);
9888 });
9989
10090 test('does not fold unsupported or malformed switch shapes', () => {
0 commit comments