llvm-project
34 строки · 2.0 Кб
1// RUN: fir-opt %s | fir-opt | FileCheck %s
2// RUN: fir-opt %s | fir-opt -cse | FileCheck %s
3
4// CHECK-LABEL: func.func @dummy_scope(
5// CHECK-SAME: %[[VAL_0:.*]]: !fir.ref<f32>) {
6// CHECK: %[[VAL_1:.*]] = fir.dummy_scope : !fir.dscope
7// CHECK: %[[VAL_2:.*]] = fir.declare %[[VAL_0]] dummy_scope %[[VAL_1]] {uniq_name = "x"} : (!fir.ref<f32>, !fir.dscope) -> !fir.ref<f32>
8// CHECK: return
9// CHECK: }
10func.func @dummy_scope(%arg0: !fir.ref<f32>) {
11%scope = fir.dummy_scope : !fir.dscope
12%0 = fir.declare %arg0 dummy_scope %scope {uniq_name = "x"} : (!fir.ref<f32>, !fir.dscope) -> !fir.ref<f32>
13return
14}
15
16// CHECK-LABEL: func.func @dummy_scopes(
17// CHECK-SAME: %[[VAL_0:.*]]: !fir.ref<f32>) {
18// CHECK: %[[VAL_1:.*]] = fir.dummy_scope : !fir.dscope
19// CHECK: %[[VAL_2:.*]] = fir.declare %[[VAL_0]] dummy_scope %[[VAL_1]] {uniq_name = "x"} : (!fir.ref<f32>, !fir.dscope) -> !fir.ref<f32>
20// CHECK: %[[VAL_3:.*]] = fir.dummy_scope : !fir.dscope
21// CHECK: %[[VAL_4:.*]] = fir.declare %[[VAL_0]] dummy_scope %[[VAL_3]] {uniq_name = "innerEx"} : (!fir.ref<f32>, !fir.dscope) -> !fir.ref<f32>
22// CHECK: %[[VAL_5:.*]] = fir.dummy_scope : !fir.dscope
23// CHECK: %[[VAL_6:.*]] = fir.declare %[[VAL_0]] dummy_scope %[[VAL_5]] {uniq_name = "innerEx"} : (!fir.ref<f32>, !fir.dscope) -> !fir.ref<f32>
24// CHECK: return
25// CHECK: }
26func.func @dummy_scopes(%arg0: !fir.ref<f32>) {
27%scope_out = fir.dummy_scope : !fir.dscope
28%0 = fir.declare %arg0 dummy_scope %scope_out {uniq_name = "x"} : (!fir.ref<f32>, !fir.dscope) -> !fir.ref<f32>
29%scope_in1 = fir.dummy_scope : !fir.dscope
30%1 = fir.declare %arg0 dummy_scope %scope_in1 {uniq_name = "innerEx"} : (!fir.ref<f32>, !fir.dscope) -> !fir.ref<f32>
31%scope_in2 = fir.dummy_scope : !fir.dscope
32%2 = fir.declare %arg0 dummy_scope %scope_in2 {uniq_name = "innerEx"} : (!fir.ref<f32>, !fir.dscope) -> !fir.ref<f32>
33return
34}
35