| 1 |
// RUN: fir-opt --add-debug-info --mlir-print-debuginfo %s | FileCheck %s |
| 2 |
|
| 3 |
module { |
| 4 |
fir.global @_QMhelperEstr1 : !fir.char<1,40> { |
| 5 |
%0 = fir.zero_bits !fir.char<1,40> |
| 6 |
fir.has_value %0 : !fir.char<1,40> |
| 7 |
} loc(#loc1) |
| 8 |
fir.global @_QMhelperEstr2 : !fir.char<4,20> { |
| 9 |
%0 = fir.zero_bits !fir.char<4,20> |
| 10 |
fir.has_value %0 : !fir.char<4,20> |
| 11 |
} loc(#loc1) |
| 12 |
fir.global @_QMhelperEstr3 : !fir.box<!fir.heap<!fir.char<1,?>>> { |
| 13 |
%c0 = arith.constant 0 : index |
| 14 |
%0 = fir.zero_bits !fir.heap<!fir.char<1,?>> |
| 15 |
%1 = fir.embox %0 typeparams %c0 : (!fir.heap<!fir.char<1,?>>, index) -> !fir.box<!fir.heap<!fir.char<1,?>>> |
| 16 |
fir.has_value %1 : !fir.box<!fir.heap<!fir.char<1,?>>> |
| 17 |
} loc(#loc1) |
| 18 |
} |
| 19 |
#loc1 = loc("string.f90":1:1) |
| 20 |
|
| 21 |
// CHECK-DAG: #[[TY1:.*]] = #llvm.di_string_type<tag = DW_TAG_string_type, name = "", sizeInBits = 320, encoding = DW_ATE_ASCII> |
| 22 |
// CHECK-DAG: #llvm.di_global_variable<{{.*}}name = "str1"{{.*}}type = #[[TY1]]{{.*}}> |
| 23 |
// CHECK-DAG: #[[TY2:.*]] = #llvm.di_string_type<tag = DW_TAG_string_type, name = "", sizeInBits = 640, encoding = DW_ATE_UCS> |
| 24 |
// CHECK-DAG: #llvm.di_global_variable<{{.*}}name = "str2"{{.*}}type = #[[TY2]]{{.*}}> |
| 25 |
// CHECK-DAG: #[[TY3:.*]] = #llvm.di_string_type<tag = DW_TAG_string_type{{.*}}stringLengthExp = <[DW_OP_push_object_address, DW_OP_plus_uconst(8)]>, stringLocationExp = <[DW_OP_push_object_address, DW_OP_deref]>, encoding = DW_ATE_ASCII> |
| 26 |
// CHECK-DAG: #llvm.di_global_variable<{{.*}}name = "str3"{{.*}}type = #[[TY3]]{{.*}}> |