@@ -1158,3 +1158,17 @@ end
11581158 issue51837 (; openquotechar, newlinechar)
11591159end |> ! Core. Compiler. is_nothrow
11601160@test_throws ArgumentError issue51837 (; openquotechar= ' α' , newlinechar= ' \n ' )
1161+
1162+ # idempotency of effects derived by post-opt analysis
1163+ callgetfield (x, f) = getfield (x, f, Base. @_boundscheck )
1164+ @test Base. infer_effects (callgetfield, (Some{Any},Symbol)). noub === Core. Compiler. NOUB_IF_NOINBOUNDS
1165+ callgetfield1 (x, f) = getfield (x, f, Base. @_boundscheck )
1166+ callgetfield_simple (x, f) = callgetfield1 (x, f)
1167+ @test Base. infer_effects (callgetfield_simple, (Some{Any},Symbol)). noub ===
1168+ Base. infer_effects (callgetfield_simple, (Some{Any},Symbol)). noub ===
1169+ Core. Compiler. ALWAYS_TRUE
1170+ callgetfield2 (x, f) = getfield (x, f, Base. @_boundscheck )
1171+ callgetfield_inbounds (x, f) = @inbounds callgetfield2 (x, f)
1172+ @test Base. infer_effects (callgetfield_inbounds, (Some{Any},Symbol)). noub ===
1173+ Base. infer_effects (callgetfield_inbounds, (Some{Any},Symbol)). noub ===
1174+ Core. Compiler. ALWAYS_FALSE
0 commit comments