Jakub Kuderski 5ab6ef758f [mlir][spirv] Change dialect name from 'spv' to 'spirv'
Tested with `check-mlir` and `check-mlir-integration`.

Issue: https://github.com/llvm/llvm-project/issues/56863

Reviewed By: antiagainst

Differential Revision: https://reviews.llvm.org/D134620
2022-09-26 10:58:30 -04:00

47 lines
1.0 KiB
MLIR

// RUN: mlir-opt -split-input-file -verify-diagnostics %s | FileCheck %s
//===----------------------------------------------------------------------===//
// spirv.Undef
//===----------------------------------------------------------------------===//
func.func @undef() -> () {
// CHECK: %{{.*}} = spirv.Undef : f32
%0 = spirv.Undef : f32
// CHECK: %{{.*}} = spirv.Undef : vector<4xf32>
%1 = spirv.Undef : vector<4xf32>
spirv.Return
}
// -----
func.func @undef() -> () {
// expected-error @+1{{expected non-function type}}
%0 = spirv.Undef :
spirv.Return
}
// -----
func.func @undef() -> () {
// expected-error @+1{{expected ':'}}
%0 = spirv.Undef
spirv.Return
}
// -----
func.func @assume_true(%arg : i1) -> () {
// CHECK: spirv.KHR.AssumeTrue %{{.*}}
spirv.KHR.AssumeTrue %arg
spirv.Return
}
// -----
func.func @assume_true(%arg : f32) -> () {
// expected-error @+2{{use of value '%arg' expects different type than prior uses: 'i1' vs 'f32'}}
// expected-note @-2 {{prior use here}}
spirv.KHR.AssumeTrue %arg
spirv.Return
}