| 1 |
// RUN: fir-opt --add-debug-info --mlir-print-debuginfo %s | FileCheck %s |
| 2 |
|
| 3 |
module { |
| 4 |
func.func @_QQmain() attributes {fir.bindc_name = "mn"} { |
| 5 |
%c7 = arith.constant 7 : index |
| 6 |
%c8 = arith.constant 8 : index |
| 7 |
%c6 = arith.constant 6 : index |
| 8 |
%c5 = arith.constant 5 : index |
| 9 |
%c2 = arith.constant 2 : index |
| 10 |
%c3 = arith.constant 3 : index |
| 11 |
%c-2 = arith.constant -2 : index loc(#loc3) |
| 12 |
%c4 = arith.constant 4 : index loc(#loc3) |
| 13 |
%0 = fir.alloca !fir.array<3xi32> {bindc_name = "d1", uniq_name = "_QFEd1"} |
| 14 |
%1 = fircg.ext_declare %0(%c3) {uniq_name = "_QFEd1"} : (!fir.ref<!fir.array<3xi32>>, index) -> !fir.ref<!fir.array<3xi32>> loc(#loc1) |
| 15 |
%2 = fir.address_of(@_QFEd2) : !fir.ref<!fir.array<2x5xi32>> |
| 16 |
%3 = fircg.ext_declare %2(%c2, %c5) {uniq_name = "_QFEd2"} : (!fir.ref<!fir.array<2x5xi32>>, index, index) -> !fir.ref<!fir.array<2x5xi32>> loc(#loc2) |
| 17 |
%4 = fir.address_of(@_QFEd3) : !fir.ref<!fir.array<6x8x7xf32>> |
| 18 |
%5 = fircg.ext_declare %4(%c6, %c8, %c7) {uniq_name = "_QFEd3"} : (!fir.ref<!fir.array<6x8x7xf32>>, index, index, index) -> !fir.ref<!fir.array<6x8x7xf32>> loc(#loc3) |
| 19 |
%6 = fir.address_of(@_QFEd4) : !fir.ref<!fir.array<6x7xi32>> |
| 20 |
%7 = fircg.ext_declare %6(%c6, %c7) origin %c-2, %c4 {uniq_name = "_QFEd4"} : (!fir.ref<!fir.array<6x7xi32>>, index, index, index, index) -> !fir.ref<!fir.array<6x7xi32>> loc(#loc5) |
| 21 |
return |
| 22 |
} loc(#loc4) |
| 23 |
} |
| 24 |
|
| 25 |
#loc1 = loc("test.f90":5:1) |
| 26 |
#loc2 = loc("test.f90":6:11) |
| 27 |
#loc3 = loc("test.f90":7:11) |
| 28 |
#loc4 = loc("test.f90":2:8) |
| 29 |
#loc5 = loc("test.f90":8:11) |
| 30 |
|
| 31 |
|
| 32 |
// CHECK-DAG: #[[INT:.*]] = #llvm.di_basic_type<tag = DW_TAG_base_type, name = "integer", sizeInBits = 32, encoding = DW_ATE_signed> |
| 33 |
// CHECK-DAG: #[[REAL:.*]] = #llvm.di_basic_type<tag = DW_TAG_base_type, name = "real", sizeInBits = 32, encoding = DW_ATE_float> |
| 34 |
// CHECK-DAG: #[[D1TY:.*]] = #llvm.di_composite_type<tag = DW_TAG_array_type{{.*}}baseType = #[[INT]], elements = #llvm.di_subrange<count = 3 : i64>> |
| 35 |
// CHECK-DAG: #[[D2TY:.*]] = #llvm.di_composite_type<tag = DW_TAG_array_type{{.*}}baseType = #[[INT]], elements = #llvm.di_subrange<count = 2 : i64>, #llvm.di_subrange<count = 5 : i64>> |
| 36 |
// CHECK-DAG: #[[D3TY:.*]] = #llvm.di_composite_type<tag = DW_TAG_array_type{{.*}}baseType = #[[REAL]], elements = #llvm.di_subrange<count = 6 : i64>, #llvm.di_subrange<count = 8 : i64>, #llvm.di_subrange<count = 7 : i64>> |
| 37 |
// CHECK-DAG: #[[D4TY:.*]] = #llvm.di_composite_type<tag = DW_TAG_array_type, baseType = #di_basic_type, elements = #llvm.di_subrange<count = 6 : i64, lowerBound = -2 : i64>, #llvm.di_subrange<count = 7 : i64, lowerBound = 4 : i64>> |
| 38 |
// CHECK-DAG: #llvm.di_local_variable<{{.*}}name = "d1"{{.*}}type = #[[D1TY]]> |
| 39 |
// CHECK-DAG: #llvm.di_local_variable<{{.*}}name = "d2"{{.*}}type = #[[D2TY]]> |
| 40 |
// CHECK-DAG: #llvm.di_local_variable<{{.*}}name = "d3"{{.*}}type = #[[D3TY]]> |
| 41 |
// CHECK-DAG: #llvm.di_local_variable<{{.*}}name = "d4"{{.*}}type = #[[D4TY]]> |