Precursor: https://reviews.llvm.org/D110200 Removed redundant ops from the standard dialect that were moved to the `arith` or `math` dialects. Renamed all instances of operations in the codebase and in tests. Reviewed By: rriddle, jpienaar Differential Revision: https://reviews.llvm.org/D110797
30 lines
1.4 KiB
Plaintext
30 lines
1.4 KiB
Plaintext
// RUN: fir-opt --external-name-interop %s | FileCheck %s
|
|
|
|
func @_QPfoo() {
|
|
%c0 = arith.constant 0 : index
|
|
%0 = fir.address_of(@_QBa) : !fir.ref<!fir.array<4xi8>>
|
|
%1 = fir.convert %0 : (!fir.ref<!fir.array<4xi8>>) -> !fir.ref<!fir.array<?xi8>>
|
|
%2 = fir.coordinate_of %1, %c0 : (!fir.ref<!fir.array<?xi8>>, index) -> !fir.ref<i8>
|
|
%3 = fir.convert %2 : (!fir.ref<i8>) -> !fir.ref<i32>
|
|
%4 = fir.address_of(@_QB) : !fir.ref<!fir.array<4xi8>>
|
|
%5 = fir.convert %4 : (!fir.ref<!fir.array<4xi8>>) -> !fir.ref<!fir.array<?xi8>>
|
|
%6 = fir.coordinate_of %5, %c0 : (!fir.ref<!fir.array<?xi8>>, index) -> !fir.ref<i8>
|
|
%7 = fir.convert %6 : (!fir.ref<i8>) -> !fir.ref<f32>
|
|
fir.call @_QPbar(%3) : (!fir.ref<i32>) -> ()
|
|
fir.call @_QPbar2(%7) : (!fir.ref<f32>) -> ()
|
|
return
|
|
}
|
|
fir.global common @_QBa(dense<0> : vector<4xi8>) : !fir.array<4xi8>
|
|
fir.global common @_QB(dense<0> : vector<4xi8>) : !fir.array<4xi8>
|
|
func private @_QPbar(!fir.ref<i32>)
|
|
func private @_QPbar2(!fir.ref<f32>)
|
|
|
|
// CHECK: func @foo_
|
|
// CHECK: %{{.*}} = fir.address_of(@a_) : !fir.ref<!fir.array<4xi8>>
|
|
// CHECK: %{{.*}} = fir.address_of(@__BLNK__) : !fir.ref<!fir.array<4xi8>>
|
|
// CHECK: fir.call @bar_
|
|
// CHECK: fir.call @bar2_
|
|
// CHECK: fir.global common @a_(dense<0> : vector<4xi8>) : !fir.array<4xi8>
|
|
// CHECK: fir.global common @__BLNK__(dense<0> : vector<4xi8>) : !fir.array<4xi8>
|
|
// CHECK: func private @bar_(!fir.ref<i32>)
|