Skip to content

Commit 22ee38e

Browse files
committed
Add test for not overdubbing pow
1 parent 83df2d6 commit 22ee38e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/compiler.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ end
1212
A[1] = 2^11
1313
end
1414

15+
@kernel function square(A, B)
16+
A[1] = B[1]^2
17+
end
18+
1519
@kernel function checked(A, a, b)
1620
A[1] = Base.Checked.checked_add(a, b)
1721
end
@@ -28,6 +32,11 @@ function compiler_testsuite()
2832
@test !any(stmt->(stmt isa Expr) && stmt.head == :invoke, CI.code)
2933
end
3034

35+
let (CI, rt) = @ka_code_typed square(CPU())(zeros(1), zeros(1), ndrange=1)
36+
# test that there is no invoke of overdub
37+
@test !any(stmt->(stmt isa Expr) && stmt.head == :invoke, CI.code)
38+
end
39+
3140
if VERSION >= v"1.5"
3241
let (CI, rt) = @ka_code_typed checked(CPU())(zeros(Int,1), 1, 2, ndrange=1)
3342
# test that there is no invoke of overdub

0 commit comments

Comments
 (0)