1// RUN: mlir-opt %s -split-input-file | FileCheck %s
2
3func @const() -> () {
4  // CHECK: %true
5  %0 = spv.Constant true
6  // CHECK: %false
7  %1 = spv.Constant false
8
9  // CHECK: %cst42_i32
10  %2 = spv.Constant 42 : i32
11  // CHECK: %cst-42_i32
12  %-2 = spv.Constant -42 : i32
13  // CHECK: %cst43_i64
14  %3 = spv.Constant 43 : i64
15
16  // CHECK: %cst_f32
17  %4 = spv.Constant 0.5 : f32
18  // CHECK: %cst_f64
19  %5 = spv.Constant 0.5 : f64
20
21  // CHECK: %cst_vec_3xi32
22  %6 = spv.Constant dense<[1, 2, 3]> : vector<3xi32>
23
24  // CHECK: %cst
25  %8 = spv.Constant [dense<3.0> : vector<2xf32>] : !spv.array<1xvector<2xf32>>
26
27  return
28}
29
30// -----
31
32spv.module Logical GLSL450 {
33  spv.GlobalVariable @global_var : !spv.ptr<f32, Input>
34
35  spv.func @addressof() -> () "None" {
36    // CHECK: %global_var_addr = spv.mlir.addressof
37    %0 = spv.mlir.addressof @global_var : !spv.ptr<f32, Input>
38    spv.Return
39  }
40}
41
42