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
32 lines
624 B
MLIR
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
|
|
}
|