| 1 |
// RUN: cir-opt %s --verify-roundtrip | FileCheck %s |
| 2 |
|
| 3 |
!void = !cir.void |
| 4 |
|
| 5 |
module { |
| 6 |
cir.func @block_address(){ |
| 7 |
%0 = cir.block_address <@block_address, "label"> : !cir.ptr<!void> |
| 8 |
cir.br ^bb1 |
| 9 |
^bb1: |
| 10 |
cir.label "label" |
| 11 |
cir.return |
| 12 |
} |
| 13 |
// CHECK: cir.func @block_address |
| 14 |
// CHECK: %0 = cir.block_address <@block_address, "label"> : !cir.ptr<!void> |
| 15 |
// CHECK: cir.br ^bb1 |
| 16 |
// CHECK: ^bb1: |
| 17 |
// CHECK: cir.label "label" |
| 18 |
// CHECK: cir.return |
| 19 |
|
| 20 |
cir.func @block_address_inside_scope() -> () { |
| 21 |
cir.scope{ |
| 22 |
%0 = cir.block_address <@block_address_inside_scope, "label"> : !cir.ptr<!void> |
| 23 |
} |
| 24 |
cir.br ^bb1 |
| 25 |
^bb1: |
| 26 |
cir.label "label" |
| 27 |
cir.return |
| 28 |
} |
| 29 |
// CHECK: cir.func @block_address_inside_scope |
| 30 |
// CHECK: cir.scope |
| 31 |
// CHECK: %0 = cir.block_address <@block_address_inside_scope, "label"> : !cir.ptr<!void> |
| 32 |
// CHECK: cir.label "label" |
| 33 |
// CHECK: cir.return |
| 34 |
} |