diff --git a/clang/test/CIR/IR/invalid.cir b/clang/test/CIR/IR/invalid.cir index 2ed718d6176f..63a6fd97b4c9 100644 --- a/clang/test/CIR/IR/invalid.cir +++ b/clang/test/CIR/IR/invalid.cir @@ -300,6 +300,31 @@ cir.func @cast24(%p : !u32i) { // ----- +!u32i = !cir.int +!u64i = !cir.int +cir.func @cast25(%p : !cir.ptr) { + %0 = cir.cast(address_space, %p : !cir.ptr), !cir.ptr // expected-error {{requires two types differ in addrspace only}} + cir.return +} + +// ----- + +!u64i = !cir.int +cir.func @cast26(%p : !cir.ptr) { + %0 = cir.cast(address_space, %p : !cir.ptr), !u64i // expected-error {{requires !cir.ptr type for source and result}} + cir.return +} + +// ----- + +!u64i = !cir.int +cir.func @cast27(%p : !u64i) { + %0 = cir.cast(address_space, %p : !u64i), !cir.ptr // expected-error {{requires !cir.ptr type for source and result}} + cir.return +} + +// ----- + !u32i = !cir.int !u8i = !cir.int module {