Files
clang-p2996/mlir/test/Dialect/Index/index-errors.mlir
Jeff Niu ddf87d6cd4 [mlir][index] Add index dialect ops and attributes
This patch adds the definitions for the operations and attributes (just
one enum attribute) for the `index` dialect.

Depends on D135688

Reviewed By: rriddle, jpienaar

Differential Revision: https://reviews.llvm.org/D135689
2022-10-21 09:46:06 -07:00

32 lines
624 B
MLIR

// RUN: mlir-opt -split-input-file -verify-diagnostics %s
func.func @invalid_cast(%a: index) {
// expected-error @below {{cast incompatible}}
%0 = index.casts %a : index to index
return
}
// -----
func.func @invalid_cast(%a: i64) {
// expected-error @below {{cast incompatible}}
%0 = index.casts %a : i64 to i64
return
}
// -----
func.func @invalid_cast(%a: index) {
// expected-error @below {{cast incompatible}}
%0 = index.castu %a : index to index
return
}
// -----
func.func @invalid_cast(%a: i64) {
// expected-error @below {{cast incompatible}}
%0 = index.castu %a : i64 to i64
return
}