45 lines · plain
1// RUN: mlir-opt %s -split-input-file | FileCheck %s2 3func.func @const() -> () {4 // CHECK: %true5 %0 = spirv.Constant true6 // CHECK: %false7 %1 = spirv.Constant false8 9 // CHECK: %cst42_i3210 %2 = spirv.Constant 42 : i3211 // CHECK: %cst-42_i3212 %-2 = spirv.Constant -42 : i3213 // CHECK: %cst43_i6414 %3 = spirv.Constant 43 : i6415 16 // CHECK-NEXT: %cst6_ui817 %9 = spirv.Constant 6 : ui8 18 19 // CHECK: %cst_f3220 %4 = spirv.Constant 0.5 : f3221 // CHECK: %cst_f6422 %5 = spirv.Constant 0.5 : f6423 24 // CHECK: %cst_vec_3xi3225 %6 = spirv.Constant dense<[1, 2, 3]> : vector<3xi32>26 27 // CHECK: %cst28 %8 = spirv.Constant [dense<3.0> : vector<2xf32>] : !spirv.array<1xvector<2xf32>>29 30 return31}32 33// -----34 35spirv.module Logical GLSL450 {36 spirv.GlobalVariable @global_var : !spirv.ptr<f32, Input>37 38 spirv.func @addressof() -> () "None" {39 // CHECK: %global_var_addr = spirv.mlir.addressof40 %0 = spirv.mlir.addressof @global_var : !spirv.ptr<f32, Input>41 spirv.Return42 }43}44 45