Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add broken test #2

Merged
merged 1 commit into from
Mar 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions test/expr_code_lowered_single_expression.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,43 @@ import MultiBroadcastFusion as MBF
expr_out = :(Base.materialize!(y1, Base.broadcasted(+, x1, x2, x3, x4)))
@test MBF.code_lowered_single_expression(expr_in) == expr_out
end

@testset "code_lowered_single_expression - examples from the wild" begin
expr_in = quote
@. ᶜcloud_fraction = quad_loop(
SG_quad,
ᶜts,
Geometry.WVector(p.precomputed.ᶜgradᵥ_q_tot),
Geometry.WVector(p.precomputed.ᶜgradᵥ_θ_liq_ice),
coeff,
ᶜmixing_length,
thermo_params,
)
end
expr_out = :(Base.materialize!(
ᶜcloud_fraction,
Base.broadcasted(
quad_loop,
SG_quad,
ᶜts,
Base.broadcasted(
Base.getproperty(Geometry, :WVector),
Base.getproperty(
Base.getproperty(p, :precomputed),
:ᶜgradᵥ_q_tot,
),
),
Base.broadcasted(
Base.getproperty(Geometry, :WVector),
Base.getproperty(
Base.getproperty(p, :precomputed),
:ᶜgradᵥ_θ_liq_ice,
),
),
coeff,
ᶜmixing_length,
thermo_params,
),
))
@test_broken MBF.code_lowered_single_expression(expr_in) == expr_out
end
Loading