47 lines · plain
1// RUN: mlir-opt -split-input-file -verify-diagnostics %s | FileCheck %s2 3//===----------------------------------------------------------------------===//4// spirv.Undef5//===----------------------------------------------------------------------===//6 7func.func @undef() -> () {8 // CHECK: %{{.*}} = spirv.Undef : f329 %0 = spirv.Undef : f3210 // CHECK: %{{.*}} = spirv.Undef : vector<4xf32>11 %1 = spirv.Undef : vector<4xf32>12 spirv.Return13}14 15// -----16 17func.func @undef() -> () {18 // expected-error @+1{{expected non-function type}}19 %0 = spirv.Undef :20 spirv.Return21}22 23// -----24 25func.func @undef() -> () {26 // expected-error @+1{{expected ':'}}27 %0 = spirv.Undef28 spirv.Return29}30 31// -----32 33func.func @assume_true(%arg : i1) -> () {34 // CHECK: spirv.KHR.AssumeTrue %{{.*}}35 spirv.KHR.AssumeTrue %arg36 spirv.Return37}38 39// -----40 41func.func @assume_true(%arg : f32) -> () {42 // expected-error @+2{{use of value '%arg' expects different type than prior uses: 'i1' vs 'f32'}}43 // expected-note @-2 {{prior use here}}44 spirv.KHR.AssumeTrue %arg45 spirv.Return46}47