Debian Codegraph @

flang/test/Transforms/debug-fixed-array-type.fir

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