17 lines · plain
1// Test hlfir.get_extent operaiton parse, verify (no errors), and unparse2// RUN: fir-opt %s | fir-opt | FileCheck %s3 4func.func @getextent(%arg0: !fir.shape<3>) {5 %0 = hlfir.get_extent %arg0 {dim = 0 : index} : (!fir.shape<3>) -> index6 %1 = hlfir.get_extent %arg0 {dim = 1 : index} : (!fir.shape<3>) -> index7 %2 = hlfir.get_extent %arg0 {dim = 2 : index} : (!fir.shape<3>) -> index8 return9}10// CHECK-LABEL: func.func @getextent11// CHECK: %[[SHAPE:.*]]: !fir.shape<3>12// CHECK-NEXT: %[[EXT0:.*]] = hlfir.get_extent %[[SHAPE]] {dim = 0 : index} : (!fir.shape<3>) -> index13// CHECK-NEXT: %[[EXT1:.*]] = hlfir.get_extent %[[SHAPE]] {dim = 1 : index} : (!fir.shape<3>) -> index14// CHECK-NEXT: %[[EXT2:.*]] = hlfir.get_extent %[[SHAPE]] {dim = 2 : index} : (!fir.shape<3>) -> index15// CHECK-NEXT: return16// CHECK-NEXT: }17