Debian Codegraph @

clang/test/CIR/IR/invalid-copy.cir

raw
1 // RUN: cir-opt %s -verify-diagnostics -split-input-file
2
3 module {
4 // Should not copy types with no data layout (unkonwn byte size).
5 cir.func @invalid_copy(%arg0 : !cir.ptr<!cir.void>, %arg1 : !cir.ptr<!cir.void>) {
6 // expected-error@+1 {{missing data layout for pointee type}}
7 cir.copy %arg0 to %arg1 : !cir.ptr<!cir.void>
8 cir.return
9 }
10 }
11
12 // -----
13
14 module {
15 // Should not copy to same address.
16 cir.func @invalid_copy(%arg0 : !cir.ptr<!cir.int<s, 8>>) {
17 // expected-error@+1 {{source and destination are the same}}
18 cir.copy %arg0 to %arg0 : !cir.ptr<!cir.int<s, 8>>
19 cir.return
20 }
21 }