Skip to content

Commit

Permalink
Merge pull request #2 from CliMA/ck/examples_from_the_wild
Browse files Browse the repository at this point in the history
Add broken test
  • Loading branch information
charleskawczynski authored Mar 9, 2024
2 parents 07a6d74 + df037ac commit 33fdb47
Showing 1 changed file with 40 additions and 0 deletions.
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

0 comments on commit 33fdb47

Please sign in to comment.