Debian Codegraph @

clang/test/CIR/IR/invalid-block-address.cir

raw
1 // RUN: cir-opt %s -verify-diagnostics -split-input-file
2
3 !void = !cir.void
4
5 // expected-error@+1 {{expects an existing label target in the referenced function}}
6 cir.func @bad_block_address() -> () {
7 %0 = cir.block_address <@bad_block_address, "label"> : !cir.ptr<!void>
8 cir.br ^bb1
9 ^bb1:
10 cir.label "wrong_label"
11 cir.return
12 }
13
14 // expected-error@+1 {{blockaddress references a different function}}
15 cir.func @bad_block_func() -> () {
16 %0 = cir.block_address <@mismatch_func, "label"> : !cir.ptr<!void>
17 cir.br ^bb1
18 ^bb1:
19 cir.label "label"
20 cir.return
21 }