xref: /llvm-project/mlir/test/Conversion/UBToSPIRV/ub-to-spirv.mlir (revision 8568921d43b1dc6e273e89397d273aeba375a513)
1// RUN: mlir-opt -split-input-file -convert-ub-to-spirv -verify-diagnostics %s | FileCheck %s
2
3module attributes {
4  spirv.target_env = #spirv.target_env<
5    #spirv.vce<v1.0, [Int8, Int16, Int64, Float16, Float64, Shader], []>, #spirv.resource_limits<>>
6} {
7
8// CHECK-LABEL: @check_poison
9func.func @check_poison() {
10// CHECK: {{.*}} = spirv.Undef : i32
11  %0 = ub.poison : index
12// CHECK: {{.*}} = spirv.Undef : i16
13  %1 = ub.poison : i16
14// CHECK: {{.*}} = spirv.Undef : f64
15  %2 = ub.poison : f64
16// TODO: vector is not covered yet
17// CHECK: {{.*}} = ub.poison : vector<4xf32>
18  %3 = ub.poison : vector<4xf32>
19  return
20}
21
22}
23