22 lines · plain
1// RUN: cir-opt %s -verify-diagnostics -split-input-file2 3module {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.return9 }10}11 12// -----13 14module {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.return20 }21}22