Skip to content

Commit 0e2d6f2

Browse files
committed
tests: fix broken test cases.
1 parent a890c7c commit 0e2d6f2

File tree

2 files changed

+53
-5
lines changed

2 files changed

+53
-5
lines changed

lib/src/compiler/ir/tests/testdata/1.no-folding.ir

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,19 @@ RULE test_1
88
11: CONST integer(1) -- parent: 12
99

1010
RULE test_2
11+
20: EQ -- hash: 0x435e2bc40faf0997 -- parent: None
12+
18: SUB -- hash: 0xcbbf8e838c34d7e1 -- parent: 20
13+
14: ADD -- hash: 0x736c700ea5e3e841 -- parent: 18
14+
12: FIELD_ACCESS -- hash: 0x33962d7e5c60ec68 -- parent: 14
15+
10: SYMBOL Field { index: 0, is_root: true, type_value: struct, acl: None } -- parent: 12
16+
11: SYMBOL Field { index: 13, is_root: false, type_value: integer(unknown), acl: None } -- parent: 12
17+
13: CONST integer(1) -- parent: 14
18+
17: FIELD_ACCESS -- hash: 0x33962d7e5c60ec68 -- parent: 18
19+
15: SYMBOL Field { index: 0, is_root: true, type_value: struct, acl: None } -- parent: 17
20+
16: SYMBOL Field { index: 13, is_root: false, type_value: integer(unknown), acl: None } -- parent: 17
21+
19: CONST integer(1) -- parent: 20
22+
23+
RULE test_3
1124
6: GT -- hash: 0x931bcdb2c7afb608 -- parent: None
1225
4: DIV -- hash: 0xf2b3602767487d08 -- parent: 6
1326
2: MUL -- hash: 0x23a380280d1b4f32 -- parent: 4
@@ -16,7 +29,7 @@ RULE test_2
1629
3: CONST integer(1) -- parent: 4
1730
5: CONST integer(1) -- parent: 6
1831

19-
RULE test_3
32+
RULE test_4
2033
6: LE -- hash: 0x63b2e857a1254c2b -- parent: None
2134
4: SHR -- hash: 0x8dd6307742aa2311 -- parent: 6
2235
2: SHL -- hash: 0x48eeb57428a0dbf0 -- parent: 4
@@ -25,7 +38,7 @@ RULE test_3
2538
3: CONST integer(1) -- parent: 4
2639
5: CONST integer(2) -- parent: 6
2740

28-
RULE test_4
41+
RULE test_5
2942
14: EQ -- hash: 0x2240111cff945ff5 -- parent: None
3043
12: SUB -- hash: 0xa076dada583953db -- parent: 14
3144
7: CONST integer(4) -- parent: 12
@@ -35,7 +48,19 @@ RULE test_4
3548
10: CONST integer(2) -- parent: 11
3649
13: CONST integer(8) -- parent: 14
3750

38-
RULE test_5
51+
RULE test_6
52+
18: EQ -- hash: 0xea1ddf3adc653142 -- parent: None
53+
11: BITWISE_XOR -- hash: 0xdd299ba912958ce8 -- parent: 18
54+
9: CONST integer(2) -- parent: 11
55+
10: CONST integer(1) -- parent: 11
56+
17: BITWISE_OR -- hash: 0xda5a8a244bcb673d -- parent: 18
57+
15: BITWISE_AND -- hash: 0x22082a7fc27dabe1 -- parent: 17
58+
13: BITWISE_NOT -- hash: 0x44d8a0dd009c8a5c -- parent: 15
59+
12: CONST integer(1) -- parent: 13
60+
14: CONST integer(1) -- parent: 15
61+
16: CONST integer(1) -- parent: 17
62+
63+
RULE test_7
3964
12: AND -- hash: 0xe533ae780a09ff03 -- parent: None
4065
8: EQ -- hash: 0x22575eadeb0769cf -- parent: 12
4166
6: FIELD_ACCESS -- hash: 0xd1ac9e3929a1ce9b -- parent: 8
@@ -46,15 +71,15 @@ RULE test_5
4671
11: NOT -- hash: 0x2c3c4fda5217a5f3 -- parent: 12
4772
10: CONST boolean(false) -- parent: 11
4873

49-
RULE test_6
74+
RULE test_8
5075
5: ADD -- hash: 0xc4e1a16fb19df223 -- parent: None
5176
2: FIELD_ACCESS -- hash: 0xd1ac9e3929a1ce9b -- parent: 5
5277
0: SYMBOL Field { index: 0, is_root: true, type_value: struct, acl: None } -- parent: 2
5378
1: SYMBOL Field { index: 1, is_root: false, type_value: integer(unknown), acl: None } -- parent: 2
5479
3: CONST integer(1) -- parent: 5
5580
4: CONST integer(2) -- parent: 5
5681

57-
RULE test_7
82+
RULE test_9
5883
18: AND -- hash: 0xb21fa80def581aea -- parent: None
5984
2: CONTAINS -- hash: 0x702eaf70b18909ff -- parent: 18
6085
0: CONST string("foobar") -- parent: 2
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
RULE test_1
2+
11: AND -- hash: 0xc2a770f728278b62 -- parent: None
3+
0: PATTERN_MATCH PatternIdx(0) -- hash: 0x33ca4b577a0ea8af -- parent: 11
4+
5: EQ -- hash: 0xe037667fbed74cb4 -- parent: 11
5+
3: PATTERN_COUNT PatternIdx(0) -- hash: 0x2706f00cf1a9933a -- parent: 5
6+
4: CONST integer(1) -- parent: 5
7+
10: EQ -- hash: 0xfac13fee1024fdba -- parent: 11
8+
8: PATTERN_OFFSET PatternIdx(0) -- hash: 0x1a4394c269447dc5 -- parent: 10
9+
9: CONST integer(0) -- parent: 10
10+
11+
RULE test_2
12+
1: PATTERN_MATCH PatternIdx(0) AT -- hash: 0x6c1af84ea5255e33 -- parent: None
13+
0: CONST integer(0) -- parent: 1
14+
15+
RULE test_3
16+
6: FOR_OF -- hash: 0x6757d113ddb8b088 -- parent: None
17+
5: OR -- hash: 0xcc445c4db8b32aa4 -- parent: 6
18+
1: PATTERN_MATCH Var { var: Var { frame_id: 1, ty: integer, index: 4 }, type_value: integer(unknown) } AT -- hash: 0xa701186afbdbc10d -- parent: 5
19+
0: CONST integer(0) -- parent: 1
20+
4: GT -- hash: 0xb49e5d335feb77cf -- parent: 5
21+
2: PATTERN_COUNT Var { var: Var { frame_id: 1, ty: integer, index: 4 }, type_value: integer(unknown) } -- hash: 0xd2940cad4d24a56 -- parent: 4
22+
3: CONST integer(0) -- parent: 4
23+

0 commit comments

Comments
 (0)