Skip to content

Commit 6139ff3

Browse files
committed
[Cranelift] add filetests
1 parent 15b3e36 commit 6139ff3

File tree

1 file changed

+51
-8
lines changed

1 file changed

+51
-8
lines changed

cranelift/filetests/filetests/egraph/fold-and-xor-not.clif

Lines changed: 51 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,57 +2,100 @@ test optimize precise-output
22
set opt_level=speed
33
target x86_64
44

5-
function %test1(i8, i8) -> i8 {
5+
function %fold_and_xor_not1(i8, i8) -> i8 {
66
block0(v0: i8, v1: i8):
77
v2 = bnot v1
88
v3 = bxor v0, v2
99
v4 = band v3, v0
1010
return v4
1111
}
1212

13-
; function %test1(i8, i8) -> i8 fast {
13+
; function %fold_and_xor_not1(i8, i8) -> i8 fast {
1414
; block0(v0: i8, v1: i8):
1515
; v5 = band v0, v1
1616
; return v5
1717
; }
1818

19-
function %test2(i16, i16) -> i16 {
19+
function %fold_and_xor_not2(i16, i16) -> i16 {
2020
block0(v0: i16, v1: i16):
2121
v2 = bnot v1
2222
v3 = bxor v0, v2
2323
v4 = band v3, v0
2424
return v4
2525
}
2626

27-
; function %test2(i16, i16) -> i16 fast {
27+
; function %fold_and_xor_not2(i16, i16) -> i16 fast {
2828
; block0(v0: i16, v1: i16):
2929
; v5 = band v0, v1
3030
; return v5
3131
; }
3232

33-
function %test3(i32, i32) -> i32 {
33+
function %fold_and_xor_not3(i32, i32) -> i32 {
3434
block0(v0: i32, v1: i32):
3535
v2 = bnot v1
3636
v3 = bxor v0, v2
3737
v4 = band v3, v0
3838
return v4
3939
}
4040

41-
; function %test3(i32, i32) -> i32 fast {
41+
; function %fold_and_xor_not3(i32, i32) -> i32 fast {
4242
; block0(v0: i32, v1: i32):
4343
; v5 = band v0, v1
4444
; return v5
4545
; }
4646

47-
function %test4(i64, i64) -> i64 {
47+
function %fold_and_xor_not4_1(i64, i64) -> i64 {
4848
block0(v0: i64, v1: i64):
4949
v2 = bnot v1
5050
v3 = bxor v0, v2
5151
v4 = band v3, v0
5252
return v4
5353
}
5454

55-
; function %test4(i64, i64) -> i64 fast {
55+
; function %fold_and_xor_not4_1(i64, i64) -> i64 fast {
56+
; block0(v0: i64, v1: i64):
57+
; v5 = band v0, v1
58+
; return v5
59+
; }
60+
61+
function %fold_and_xor_not4_2(i64, i64) -> i64 {
62+
block0(v0: i64, v1: i64):
63+
v2 = bnot v1
64+
v3 = bxor v2, v0
65+
v4 = band v3, v0
66+
return v4
67+
}
68+
69+
; function %fold_and_xor_not4_2(i64, i64) -> i64 fast {
70+
; block0(v0: i64, v1: i64):
71+
; v5 = band v0, v1
72+
; return v5
73+
; }
74+
75+
76+
function %fold_and_xor_not4_3(i64, i64) -> i64 {
77+
block0(v0: i64, v1: i64):
78+
v2 = bnot v1
79+
v3 = bxor v0, v2
80+
v4 = band v0, v3
81+
return v4
82+
}
83+
84+
; function %fold_and_xor_not4_3(i64, i64) -> i64 fast {
85+
; block0(v0: i64, v1: i64):
86+
; v5 = band v0, v1
87+
; return v5
88+
; }
89+
90+
function %fold_and_xor_not4_4(i64, i64) -> i64 {
91+
block0(v0: i64, v1: i64):
92+
v2 = bnot v1
93+
v3 = bxor v2, v0
94+
v4 = band v0, v3
95+
return v4
96+
}
97+
98+
; function %fold_and_xor_not4_4(i64, i64) -> i64 fast {
5699
; block0(v0: i64, v1: i64):
57100
; v5 = band v0, v1
58101
; return v5

0 commit comments

Comments
 (0)