1// RUN: mlir-translate -split-input-file -test-spirv-roundtrip %s | FileCheck %s
2
3spv.module Logical GLSL450 requires #spv.vce<v1.0, [Shader], []> {
4  // CHECK: location = 0 : i32
5  spv.globalVariable @var {location = 0 : i32} : !spv.ptr<vector<4xf32>, Input>
6}
7
8// -----
9
10spv.module Logical GLSL450 requires #spv.vce<v1.0, [Shader], []> {
11  // CHECK: no_perspective
12  spv.globalVariable @var {no_perspective} : !spv.ptr<vector<4xf32>, Input>
13}
14
15// -----
16
17spv.module Logical GLSL450 requires #spv.vce<v1.0, [Shader], []> {
18  // CHECK: flat
19  spv.globalVariable @var {flat} : !spv.ptr<si32, Input>
20}
21
22// -----
23
24spv.module Logical GLSL450 requires #spv.vce<v1.0, [Shader], []> {
25  // CHECK: aliased
26  // CHECK: aliased
27  spv.globalVariable @var1 bind(0, 0) {aliased} : !spv.ptr<!spv.struct<(!spv.array<4xf32, stride=4>[0])>, StorageBuffer>
28  spv.globalVariable @var2 bind(0, 0) {aliased} : !spv.ptr<!spv.struct<(vector<4xf32>[0])>, StorageBuffer>
29}
30
31// -----
32
33spv.module Logical GLSL450 requires #spv.vce<v1.0, [Shader], []> {
34  // CHECK: non_readable
35  spv.globalVariable @var bind(0, 0) {non_readable} : !spv.ptr<!spv.struct<(!spv.array<4xf32, stride=4>[0])>, StorageBuffer>
36}
37
38// -----
39
40spv.module Logical GLSL450 requires #spv.vce<v1.0, [Shader], []> {
41  // CHECK: non_writable
42  spv.globalVariable @var bind(0, 0) {non_writable} : !spv.ptr<!spv.struct<(!spv.array<4xf32, stride=4>[0])>, StorageBuffer>
43}
44
45// -----
46
47spv.module Logical GLSL450 requires #spv.vce<v1.0, [Shader], []> {
48  // CHECK: restrict
49  spv.globalVariable @var bind(0, 0) {restrict} : !spv.ptr<!spv.struct<(!spv.array<4xf32, stride=4>[0])>, StorageBuffer>
50}
51
52