Skip to content

Commit 27ccab9

Browse files
test: test CSE on ranges
1 parent 4a6a23e commit 27ccab9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/cse.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,3 +220,12 @@ end
220220
@test all(iszero, arr[1:3])
221221
@test all(iszero, arr[8:end])
222222
end
223+
224+
@testset "CSE doesn't affect ranges" begin
225+
@syms x::Array
226+
t = term(view, x, 1:3)
227+
fnexpr = Func([x], [], t)
228+
fn1 = @RuntimeGeneratedFunction(toexpr(fnexpr))
229+
fn2 = @RuntimeGeneratedFunction(cse(toexpr(fnexpr)))
230+
@test fn1(ones(5)) == fn2(ones(5))
231+
end

0 commit comments

Comments
 (0)