// Test side effects of hlfir.assign op. // RUN: fir-opt %s --test-side-effects --verify-diagnostics func.func @test1(%x: !fir.ref, %i: i32) { // expected-remark @below {{found an instance of 'write' on op operand 1, on resource ''}} hlfir.assign %i to %x : i32, !fir.ref return } func.func @test2(%x: !fir.ref, %y: !fir.ref) { // expected-remark @below {{found an instance of 'write' on op operand 1, on resource ''}} // expected-remark @below {{found an instance of 'read' on op operand 0, on resource ''}} hlfir.assign %y to %x : !fir.ref, !fir.ref return } func.func @test3(%x: !fir.ref>, %y: !fir.ref>) { // expected-remark @below {{found an instance of 'write' on resource ''}} // expected-remark @below {{found an instance of 'read' on resource ''}} hlfir.assign %y to %x : !fir.ref>, !fir.ref> return } func.func @test4(%x: !fir.ref>>>, %y: !fir.box>) { // expected-remark @below {{found an instance of 'read' on op operand 0, on resource ''}} // expected-remark @below {{found an instance of 'read' on op operand 1, on resource ''}} // expected-remark @below {{found an instance of 'write' on resource ''}} // expected-remark @below {{found an instance of 'free' on resource ''}} // expected-remark @below {{found an instance of 'allocate' on resource ''}} hlfir.assign %y to %x realloc : !fir.box>, !fir.ref>>> return }