// RUN: fir-opt %s | fir-opt | FileCheck %s // RUN: fir-opt %s | fir-opt -cse | FileCheck %s // CHECK-LABEL: func.func @dummy_scope( // CHECK-SAME: %[[VAL_0:.*]]: !fir.ref) { // CHECK: %[[VAL_1:.*]] = fir.dummy_scope : !fir.dscope // CHECK: %[[VAL_2:.*]] = fir.declare %[[VAL_0]] dummy_scope %[[VAL_1]] {uniq_name = "x"} : (!fir.ref, !fir.dscope) -> !fir.ref // CHECK: return // CHECK: } func.func @dummy_scope(%arg0: !fir.ref) { %scope = fir.dummy_scope : !fir.dscope %0 = fir.declare %arg0 dummy_scope %scope {uniq_name = "x"} : (!fir.ref, !fir.dscope) -> !fir.ref return } // CHECK-LABEL: func.func @dummy_scopes( // CHECK-SAME: %[[VAL_0:.*]]: !fir.ref) { // CHECK: %[[VAL_1:.*]] = fir.dummy_scope : !fir.dscope // CHECK: %[[VAL_2:.*]] = fir.declare %[[VAL_0]] dummy_scope %[[VAL_1]] {uniq_name = "x"} : (!fir.ref, !fir.dscope) -> !fir.ref // CHECK: %[[VAL_3:.*]] = fir.dummy_scope : !fir.dscope // CHECK: %[[VAL_4:.*]] = fir.declare %[[VAL_0]] dummy_scope %[[VAL_3]] {uniq_name = "innerEx"} : (!fir.ref, !fir.dscope) -> !fir.ref // CHECK: %[[VAL_5:.*]] = fir.dummy_scope : !fir.dscope // CHECK: %[[VAL_6:.*]] = fir.declare %[[VAL_0]] dummy_scope %[[VAL_5]] {uniq_name = "innerEx"} : (!fir.ref, !fir.dscope) -> !fir.ref // CHECK: return // CHECK: } func.func @dummy_scopes(%arg0: !fir.ref) { %scope_out = fir.dummy_scope : !fir.dscope %0 = fir.declare %arg0 dummy_scope %scope_out {uniq_name = "x"} : (!fir.ref, !fir.dscope) -> !fir.ref %scope_in1 = fir.dummy_scope : !fir.dscope %1 = fir.declare %arg0 dummy_scope %scope_in1 {uniq_name = "innerEx"} : (!fir.ref, !fir.dscope) -> !fir.ref %scope_in2 = fir.dummy_scope : !fir.dscope %2 = fir.declare %arg0 dummy_scope %scope_in2 {uniq_name = "innerEx"} : (!fir.ref, !fir.dscope) -> !fir.ref return }