llvm-project/flang/test/Fir/dummy-scope-codegen.fir
Abid Qadeer cd5ee2715e
[reland][flang] Initial debug info support for local variables (#92304)
This is same as #90905 with an added fix. The issue was that we
generated variable info even when user asked for line-tables-only. This
caused llvm dwarf generation code to fail an assertion as it expected an
empty variable list.

Fixed by not generating debug info for variables when user wants only
line table. I also updated a test check for this case.
2024-05-16 09:10:59 +01:00

14 lines
616 B
Plaintext

// RUN: fir-opt --cg-rewrite="preserve-declare=true" %s -o - | FileCheck %s --check-prefixes DECL
// RUN: fir-opt --cg-rewrite="preserve-declare=false" %s -o - | FileCheck %s --check-prefixes NODECL
// RUN: fir-opt --cg-rewrite %s -o - | FileCheck %s --check-prefixes NODECL
func.func @dummy_scope(%arg0: !fir.ref<f32>) {
%scope = fir.dummy_scope : !fir.dscope
%0 = fir.declare %arg0 dummy_scope %scope {uniq_name = "x"} : (!fir.ref<f32>, !fir.dscope) -> !fir.ref<f32>
return
}
// DECL-LABEL: func.func @dummy_scope(
// DECL: fircg.ext_declare
// NODECL-LABEL: func.func @dummy_scope(
// NODECL-NEXT: return