|
87 | 87 | @test test_mod.ccall_with_sparams(Int) === 1 |
88 | 88 | @test test_mod.ccall_with_sparams(Float64) === 1.0 |
89 | 89 |
|
90 | | -# Test that ccall can be passed static parameters in the function name |
91 | | -JuliaLowering.include_string(test_mod, raw""" |
92 | | -# In principle, may add other strlen-like functions here for different string |
93 | | -# types |
94 | | -ccallable_sptest_name(::Type{String}) = :strlen |
95 | | -
|
96 | | -function ccall_with_sparams_in_name(s::T) where {T} |
97 | | - ccall(ccallable_sptest_name(T), Csize_t, (Cstring,), s) |
98 | | -end |
99 | | -""") |
100 | | -@test test_mod.ccall_with_sparams_in_name("hii") == 3 |
| 90 | +# FIXME Currently JL cannot handle `@generated` functions, so the following test cases are commented out. |
| 91 | +# # Test that ccall can be passed static parameters in the function name |
| 92 | +# # Note that this only works with `@generated` functions from 1.13 onwards, |
| 93 | +# # where the function name can be evaluated at code generation time. |
| 94 | +# JuliaLowering.include_string(test_mod, raw""" |
| 95 | +# # In principle, may add other strlen-like functions here for different string |
| 96 | +# # types |
| 97 | +# ccallable_sptest_name(::Type{String}) = :strlen |
| 98 | +# |
| 99 | +# @generated function ccall_with_sparams_in_name(s::T) where {T} |
| 100 | +# name = QuoteNode(ccallable_sptest_name(T)) |
| 101 | +# :(ccall($name, Csize_t, (Cstring,), s)) |
| 102 | +# end |
| 103 | +# """) |
| 104 | +# @test test_mod.ccall_with_sparams_in_name("hii") == 3 |
101 | 105 |
|
102 | 106 | @testset "CodeInfo: has_image_globalref" begin |
103 | 107 | @test lower_str(test_mod, "x + y").args[1].has_image_globalref === false |
|
0 commit comments