Skip to content

Commit

Permalink
tests: fix broken test cases.
Browse files Browse the repository at this point in the history
  • Loading branch information
plusvic committed Dec 3, 2024
1 parent a890c7c commit 0e2d6f2
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 5 deletions.
35 changes: 30 additions & 5 deletions lib/src/compiler/ir/tests/testdata/1.no-folding.ir
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,19 @@ RULE test_1
11: CONST integer(1) -- parent: 12

RULE test_2
20: EQ -- hash: 0x435e2bc40faf0997 -- parent: None
18: SUB -- hash: 0xcbbf8e838c34d7e1 -- parent: 20
14: ADD -- hash: 0x736c700ea5e3e841 -- parent: 18
12: FIELD_ACCESS -- hash: 0x33962d7e5c60ec68 -- parent: 14
10: SYMBOL Field { index: 0, is_root: true, type_value: struct, acl: None } -- parent: 12
11: SYMBOL Field { index: 13, is_root: false, type_value: integer(unknown), acl: None } -- parent: 12
13: CONST integer(1) -- parent: 14
17: FIELD_ACCESS -- hash: 0x33962d7e5c60ec68 -- parent: 18
15: SYMBOL Field { index: 0, is_root: true, type_value: struct, acl: None } -- parent: 17
16: SYMBOL Field { index: 13, is_root: false, type_value: integer(unknown), acl: None } -- parent: 17
19: CONST integer(1) -- parent: 20

RULE test_3
6: GT -- hash: 0x931bcdb2c7afb608 -- parent: None
4: DIV -- hash: 0xf2b3602767487d08 -- parent: 6
2: MUL -- hash: 0x23a380280d1b4f32 -- parent: 4
Expand All @@ -16,7 +29,7 @@ RULE test_2
3: CONST integer(1) -- parent: 4
5: CONST integer(1) -- parent: 6

RULE test_3
RULE test_4
6: LE -- hash: 0x63b2e857a1254c2b -- parent: None
4: SHR -- hash: 0x8dd6307742aa2311 -- parent: 6
2: SHL -- hash: 0x48eeb57428a0dbf0 -- parent: 4
Expand All @@ -25,7 +38,7 @@ RULE test_3
3: CONST integer(1) -- parent: 4
5: CONST integer(2) -- parent: 6

RULE test_4
RULE test_5
14: EQ -- hash: 0x2240111cff945ff5 -- parent: None
12: SUB -- hash: 0xa076dada583953db -- parent: 14
7: CONST integer(4) -- parent: 12
Expand All @@ -35,7 +48,19 @@ RULE test_4
10: CONST integer(2) -- parent: 11
13: CONST integer(8) -- parent: 14

RULE test_5
RULE test_6
18: EQ -- hash: 0xea1ddf3adc653142 -- parent: None
11: BITWISE_XOR -- hash: 0xdd299ba912958ce8 -- parent: 18
9: CONST integer(2) -- parent: 11
10: CONST integer(1) -- parent: 11
17: BITWISE_OR -- hash: 0xda5a8a244bcb673d -- parent: 18
15: BITWISE_AND -- hash: 0x22082a7fc27dabe1 -- parent: 17
13: BITWISE_NOT -- hash: 0x44d8a0dd009c8a5c -- parent: 15
12: CONST integer(1) -- parent: 13
14: CONST integer(1) -- parent: 15
16: CONST integer(1) -- parent: 17

RULE test_7
12: AND -- hash: 0xe533ae780a09ff03 -- parent: None
8: EQ -- hash: 0x22575eadeb0769cf -- parent: 12
6: FIELD_ACCESS -- hash: 0xd1ac9e3929a1ce9b -- parent: 8
Expand All @@ -46,15 +71,15 @@ RULE test_5
11: NOT -- hash: 0x2c3c4fda5217a5f3 -- parent: 12
10: CONST boolean(false) -- parent: 11

RULE test_6
RULE test_8
5: ADD -- hash: 0xc4e1a16fb19df223 -- parent: None
2: FIELD_ACCESS -- hash: 0xd1ac9e3929a1ce9b -- parent: 5
0: SYMBOL Field { index: 0, is_root: true, type_value: struct, acl: None } -- parent: 2
1: SYMBOL Field { index: 1, is_root: false, type_value: integer(unknown), acl: None } -- parent: 2
3: CONST integer(1) -- parent: 5
4: CONST integer(2) -- parent: 5

RULE test_7
RULE test_9
18: AND -- hash: 0xb21fa80def581aea -- parent: None
2: CONTAINS -- hash: 0x702eaf70b18909ff -- parent: 18
0: CONST string("foobar") -- parent: 2
Expand Down
23 changes: 23 additions & 0 deletions lib/src/compiler/ir/tests/testdata/9.no-folding.ir
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
RULE test_1
11: AND -- hash: 0xc2a770f728278b62 -- parent: None
0: PATTERN_MATCH PatternIdx(0) -- hash: 0x33ca4b577a0ea8af -- parent: 11
5: EQ -- hash: 0xe037667fbed74cb4 -- parent: 11
3: PATTERN_COUNT PatternIdx(0) -- hash: 0x2706f00cf1a9933a -- parent: 5
4: CONST integer(1) -- parent: 5
10: EQ -- hash: 0xfac13fee1024fdba -- parent: 11
8: PATTERN_OFFSET PatternIdx(0) -- hash: 0x1a4394c269447dc5 -- parent: 10
9: CONST integer(0) -- parent: 10

RULE test_2
1: PATTERN_MATCH PatternIdx(0) AT -- hash: 0x6c1af84ea5255e33 -- parent: None
0: CONST integer(0) -- parent: 1

RULE test_3
6: FOR_OF -- hash: 0x6757d113ddb8b088 -- parent: None
5: OR -- hash: 0xcc445c4db8b32aa4 -- parent: 6
1: PATTERN_MATCH Var { var: Var { frame_id: 1, ty: integer, index: 4 }, type_value: integer(unknown) } AT -- hash: 0xa701186afbdbc10d -- parent: 5
0: CONST integer(0) -- parent: 1
4: GT -- hash: 0xb49e5d335feb77cf -- parent: 5
2: PATTERN_COUNT Var { var: Var { frame_id: 1, ty: integer, index: 4 }, type_value: integer(unknown) } -- hash: 0xd2940cad4d24a56 -- parent: 4
3: CONST integer(0) -- parent: 4

0 comments on commit 0e2d6f2

Please sign in to comment.