1// RUN: mlir-opt -split-input-file -verify-diagnostics %s | FileCheck %s 2 3//===----------------------------------------------------------------------===// 4// spv.Undef 5//===----------------------------------------------------------------------===// 6 7func.func @undef() -> () { 8 // CHECK: %{{.*}} = spv.Undef : f32 9 %0 = spv.Undef : f32 10 // CHECK: %{{.*}} = spv.Undef : vector<4xf32> 11 %1 = spv.Undef : vector<4xf32> 12 spv.Return 13} 14 15// ----- 16 17func.func @undef() -> () { 18 // expected-error @+1{{expected non-function type}} 19 %0 = spv.Undef : 20 spv.Return 21} 22 23// ----- 24 25func.func @undef() -> () { 26 // expected-error @+1{{expected ':'}} 27 %0 = spv.Undef 28 spv.Return 29} 30 31// ----- 32 33func.func @assume_true(%arg : i1) -> () { 34 // CHECK: spv.AssumeTrueKHR %{{.*}} 35 spv.AssumeTrueKHR %arg 36 spv.Return 37} 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 spv.AssumeTrueKHR %arg 45 spv.Return 46} 47