forked from JuliaLang/julia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreflection.jl
33 lines (25 loc) · 1001 Bytes
/
reflection.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# code_native / code_llvm (issue #8239)
# redirect stdout and stderr to avoid spam during tests.
oldout = STDOUT
olderr = STDERR
redirect_stdout()
redirect_stderr()
# It's hard to really test these, but just running them should be
# sufficient to catch segfault bugs.
@test code_native(ismatch, (Regex, AbstractString)) == nothing
@test code_native(+, (Int, Int)) == nothing
@test code_native(+, (Array{Float32}, Array{Float32})) == nothing
@test code_llvm(ismatch, (Regex, AbstractString)) == nothing
@test code_llvm(+, (Int, Int)) == nothing
@test code_llvm(+, (Array{Float32}, Array{Float32})) == nothing
redirect_stdout(oldout)
redirect_stderr(olderr)
@test_throws Exception code_native(+, Int, Int)
@test_throws Exception code_native(+, Array{Float32}, Array{Float32})
@test_throws Exception code_llvm(+, Int, Int)
@test_throws Exception code_llvm(+, Array{Float32}, Array{Float32})
# isbits
@test !isbits(Array{Int})
@test isbits(Float32)
@test isbits(Int)
@test !isbits(AbstractString)