xref: /llvm-project/flang/test/Fir/dummy-scope-codegen.fir (revision cd5ee2715e89ad31982f91cc85fc3939977f2f4e)
1// RUN: fir-opt --cg-rewrite="preserve-declare=true" %s -o - | FileCheck %s --check-prefixes DECL
2// RUN: fir-opt --cg-rewrite="preserve-declare=false" %s -o - | FileCheck %s --check-prefixes NODECL
3// RUN: fir-opt --cg-rewrite %s -o - | FileCheck %s  --check-prefixes NODECL
4
5func.func @dummy_scope(%arg0: !fir.ref<f32>) {
6  %scope = fir.dummy_scope : !fir.dscope
7  %0 = fir.declare %arg0 dummy_scope %scope {uniq_name = "x"} : (!fir.ref<f32>, !fir.dscope) -> !fir.ref<f32>
8  return
9}
10// DECL-LABEL: func.func @dummy_scope(
11// DECL: fircg.ext_declare
12
13// NODECL-LABEL: func.func @dummy_scope(
14// NODECL-NEXT: return